SYMBOL INDEX (266 symbols across 29 files) FILE: demo_gr.py function get_models (line 27) | def get_models(name: str, device: torch.device, offload: bool, is_schnel... class FluxGenerator (line 36) | class FluxGenerator: method __init__ (line 37) | def __init__(self, model_name: str, device: str, offload: bool, track_... method generate_image (line 51) | def generate_image( function create_demo (line 175) | def create_demo( FILE: demo_st.py function get_models (line 32) | def get_models(name: str, device: torch.device, offload: bool, is_schnel... function get_image (line 41) | def get_image() -> torch.Tensor | None: function main (line 58) | def main( function app (line 292) | def app(): FILE: demo_st_fill.py function add_border_and_mask (line 31) | def add_border_and_mask(image, zoom_all=1.0, zoom_left=0, zoom_right=0, ... function get_models (line 83) | def get_models(name: str, device: torch.device, offload: bool): function resize (line 92) | def resize(img: Image.Image, min_mp: float = 0.5, max_mp: float = 2.0) -... function clear_canvas_state (line 116) | def clear_canvas_state(): function set_new_image (line 124) | def set_new_image(img: Image.Image): function downscale_image (line 131) | def downscale_image(img: Image.Image, scale_factor: float) -> Image.Image: function main (line 148) | def main( function app (line 497) | def app(): FILE: src/flux/cli.py class SamplingOptions (line 26) | class SamplingOptions: function parse_prompt (line 35) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function main (line 103) | def main( FILE: src/flux/cli_control.py class SamplingOptions (line 17) | class SamplingOptions: function parse_prompt (line 28) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 95) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function parse_lora_scale (line 134) | def parse_lora_scale(options: SamplingOptions | None) -> tuple[SamplingO... function main (line 162) | def main( FILE: src/flux/cli_fill.py class SamplingOptions (line 17) | class SamplingOptions: function parse_prompt (line 28) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 73) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function parse_img_mask_path (line 119) | def parse_img_mask_path(options: SamplingOptions | None) -> SamplingOpti... function main (line 175) | def main( FILE: src/flux/cli_kontext.py class SamplingOptions (line 24) | class SamplingOptions: function parse_prompt (line 34) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 108) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function main (line 150) | def main( FILE: src/flux/cli_redux.py class SamplingOptions (line 24) | class SamplingOptions: function parse_prompt (line 34) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 99) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function main (line 139) | def main( FILE: src/flux/content_filters.py class PixtralContentFilter (line 59) | class PixtralContentFilter(torch.nn.Module): method __init__ (line 60) | def __init__( method yes_no_logit_processor (line 78) | def yes_no_logit_processor( method test_image (line 92) | def test_image(self, image: Image.Image | str | torch.Tensor) -> bool: method test_txt (line 144) | def test_txt(self, txt: str) -> bool: FILE: src/flux/math.py function attention (line 6) | def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor) -> Tensor: function rope (line 15) | def rope(pos: Tensor, dim: int, theta: int) -> Tensor: function apply_rope (line 25) | def apply_rope(xq: Tensor, xk: Tensor, freqs_cis: Tensor) -> tuple[Tenso... FILE: src/flux/model.py class FluxParams (line 18) | class FluxParams: class Flux (line 34) | class Flux(nn.Module): method __init__ (line 39) | def __init__(self, params: FluxParams): method forward (line 84) | def forward( class FluxLoraWrapper (line 122) | class FluxLoraWrapper(Flux): method __init__ (line 123) | def __init__( method set_lora_scale (line 140) | def set_lora_scale(self, scale: float) -> None: FILE: src/flux/modules/autoencoder.py class AutoEncoderParams (line 9) | class AutoEncoderParams: function swish (line 21) | def swish(x: Tensor) -> Tensor: class AttnBlock (line 25) | class AttnBlock(nn.Module): method __init__ (line 26) | def __init__(self, in_channels: int): method attention (line 37) | def attention(self, h_: Tensor) -> Tensor: method forward (line 51) | def forward(self, x: Tensor) -> Tensor: class ResnetBlock (line 55) | class ResnetBlock(nn.Module): method __init__ (line 56) | def __init__(self, in_channels: int, out_channels: int): method forward (line 69) | def forward(self, x): class Downsample (line 85) | class Downsample(nn.Module): method __init__ (line 86) | def __init__(self, in_channels: int): method forward (line 91) | def forward(self, x: Tensor): class Upsample (line 98) | class Upsample(nn.Module): method __init__ (line 99) | def __init__(self, in_channels: int): method forward (line 103) | def forward(self, x: Tensor): class Encoder (line 109) | class Encoder(nn.Module): method __init__ (line 110) | def __init__( method forward (line 159) | def forward(self, x: Tensor) -> Tensor: class Decoder (line 183) | class Decoder(nn.Module): method __init__ (line 184) | def __init__( method forward (line 237) | def forward(self, z: Tensor) -> Tensor: class DiagonalGaussian (line 267) | class DiagonalGaussian(nn.Module): method __init__ (line 268) | def __init__(self, sample: bool = True, chunk_dim: int = 1): method forward (line 273) | def forward(self, z: Tensor) -> Tensor: class AutoEncoder (line 282) | class AutoEncoder(nn.Module): method __init__ (line 283) | def __init__(self, params: AutoEncoderParams, sample_z: bool = False): method encode (line 308) | def encode(self, x: Tensor) -> Tensor: method decode (line 313) | def decode(self, z: Tensor) -> Tensor: method forward (line 317) | def forward(self, x: Tensor) -> Tensor: FILE: src/flux/modules/conditioner.py class HFEmbedder (line 5) | class HFEmbedder(nn.Module): method __init__ (line 6) | def __init__(self, version: str, max_length: int, **hf_kwargs): method forward (line 21) | def forward(self, text: list[str]) -> Tensor: FILE: src/flux/modules/image_embedders.py class DepthImageEncoder (line 13) | class DepthImageEncoder: method __init__ (line 16) | def __init__(self, device): method __call__ (line 21) | def __call__(self, img: torch.Tensor) -> torch.Tensor: class CannyImageEncoder (line 36) | class CannyImageEncoder: method __init__ (line 37) | def __init__( method __call__ (line 47) | def __call__(self, img: torch.Tensor) -> torch.Tensor: class ReduxImageEncoder (line 64) | class ReduxImageEncoder(nn.Module): method __init__ (line 67) | def __init__( method __call__ (line 92) | def __call__(self, x: Image.Image) -> torch.Tensor: FILE: src/flux/modules/layers.py class EmbedND (line 11) | class EmbedND(nn.Module): method __init__ (line 12) | def __init__(self, dim: int, theta: int, axes_dim: list[int]): method forward (line 18) | def forward(self, ids: Tensor) -> Tensor: function timestep_embedding (line 28) | def timestep_embedding(t: Tensor, dim, max_period=10000, time_factor: fl... class MLPEmbedder (line 52) | class MLPEmbedder(nn.Module): method __init__ (line 53) | def __init__(self, in_dim: int, hidden_dim: int): method forward (line 59) | def forward(self, x: Tensor) -> Tensor: class RMSNorm (line 63) | class RMSNorm(torch.nn.Module): method __init__ (line 64) | def __init__(self, dim: int): method forward (line 68) | def forward(self, x: Tensor): class QKNorm (line 75) | class QKNorm(torch.nn.Module): method __init__ (line 76) | def __init__(self, dim: int): method forward (line 81) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> tuple[Tensor, Te... class SelfAttention (line 87) | class SelfAttention(nn.Module): method __init__ (line 88) | def __init__(self, dim: int, num_heads: int = 8, qkv_bias: bool = False): method forward (line 97) | def forward(self, x: Tensor, pe: Tensor) -> Tensor: class ModulationOut (line 107) | class ModulationOut: class Modulation (line 113) | class Modulation(nn.Module): method __init__ (line 114) | def __init__(self, dim: int, double: bool): method forward (line 120) | def forward(self, vec: Tensor) -> tuple[ModulationOut, ModulationOut |... class DoubleStreamBlock (line 129) | class DoubleStreamBlock(nn.Module): method __init__ (line 130) | def __init__(self, hidden_size: int, num_heads: int, mlp_ratio: float,... method forward (line 158) | def forward(self, img: Tensor, txt: Tensor, vec: Tensor, pe: Tensor) -... class SingleStreamBlock (line 194) | class SingleStreamBlock(nn.Module): method __init__ (line 200) | def __init__( method forward (line 227) | def forward(self, x: Tensor, vec: Tensor, pe: Tensor) -> Tensor: class LastLayer (line 242) | class LastLayer(nn.Module): method __init__ (line 243) | def __init__(self, hidden_size: int, patch_size: int, out_channels: int): method forward (line 249) | def forward(self, x: Tensor, vec: Tensor) -> Tensor: FILE: src/flux/modules/lora.py function replace_linear_with_lora (line 5) | def replace_linear_with_lora( class LinearLora (line 34) | class LinearLora(nn.Linear): method __init__ (line 35) | def __init__( method set_scale (line 84) | def set_scale(self, scale: float) -> None: method forward (line 88) | def forward(self, input: torch.Tensor) -> torch.Tensor: FILE: src/flux/sampling.py function get_noise (line 17) | def get_noise( function prepare (line 36) | def prepare(t5: HFEmbedder, clip: HFEmbedder, img: Tensor, prompt: str |... function prepare_control (line 70) | def prepare_control( function prepare_fill (line 107) | def prepare_fill( function prepare_redux (line 160) | def prepare_redux( function prepare_kontext (line 210) | def prepare_kontext( function time_shift (line 277) | def time_shift(mu: float, sigma: float, t: Tensor): function get_lin_function (line 281) | def get_lin_function( function get_schedule (line 289) | def get_schedule( function denoise (line 308) | def denoise( function unpack (line 356) | def unpack(x: Tensor, height: int, width: int) -> Tensor: FILE: src/flux/trt/engine/base_engine.py class SharedMemory (line 32) | class SharedMemory(object): method __new__ (line 33) | def __new__(cls, *args, **kwargs): method __init__ (line 39) | def __init__(self, size: int, device=torch.device("cuda")): method resize (line 48) | def resize(self, name: str, size: int): method reset (line 54) | def reset(self, name: str): method deallocate (line 61) | def deallocate(self): method shared_device_memory (line 72) | def shared_device_memory(self): method __str__ (line 75) | def __str__(self): class BaseEngine (line 99) | class BaseEngine(ABC): method trt_datatype_to_torch (line 101) | def trt_datatype_to_torch(datatype): method cpu (line 118) | def cpu(self) -> "BaseEngine": method cuda (line 122) | def cuda(self) -> "BaseEngine": method to (line 126) | def to(self, device: str | torch.device) -> "BaseEngine": class Engine (line 130) | class Engine(BaseEngine): method __init__ (line 131) | def __init__( method __call__ (line 157) | def __call__(self, *args, **Kwargs) -> torch.Tensor | dict[str, torch.... method cpu (line 160) | def cpu(self) -> "Engine": method cuda (line 171) | def cuda(self) -> "Engine": method to (line 182) | def to(self, device: str | torch.device) -> "Engine": method deactivate (line 194) | def deactivate(self): method allocate_buffers (line 198) | def allocate_buffers( method get_dtype (line 220) | def get_dtype(self, tensor_name: str): method override_shapes (line 223) | def override_shapes(self, feed_dict: Dict[str, torch.Tensor]): method deallocate_buffers (line 249) | def deallocate_buffers(self): method device_memory_size (line 258) | def device_memory_size(self): method calculate_input_hash (line 267) | def calculate_input_hash(feed_dict: Dict[str, torch.Tensor]): method _capture_cuda_graph (line 270) | def _capture_cuda_graph(self): method infer (line 280) | def infer( method __str__ (line 297) | def __str__(self): FILE: src/flux/trt/engine/clip_engine.py class CLIPEngine (line 24) | class CLIPEngine(Engine): method __init__ (line 25) | def __init__(self, trt_config: ClipConfig, stream: torch.cuda.Stream, ... method __call__ (line 33) | def __call__( FILE: src/flux/trt/engine/t5_engine.py class T5Engine (line 24) | class T5Engine(Engine): method __init__ (line 25) | def __init__(self, trt_config: T5Config, stream: torch.cuda.Stream, **... method __call__ (line 33) | def __call__( FILE: src/flux/trt/engine/transformer_engine.py class TransformerEngine (line 23) | class TransformerEngine(Engine): method __init__ (line 46) | def __init__(self, trt_config: TransformerConfig, stream: torch.cuda.S... method dd_to_flux (line 50) | def dd_to_flux(self): method flux_to_dd (line 54) | def flux_to_dd(self): method __call__ (line 58) | def __call__( FILE: src/flux/trt/engine/vae_engine.py class VAEDecoder (line 23) | class VAEDecoder(Engine): method __init__ (line 24) | def __init__(self, trt_config: VAEDecoderConfig, stream: torch.cuda.St... method __call__ (line 28) | def __call__( class VAEEncoder (line 39) | class VAEEncoder(Engine): method __init__ (line 40) | def __init__(self, trt_config: VAEEncoderConfig, stream: torch.cuda.St... method __call__ (line 44) | def __call__( class VAEEngine (line 54) | class VAEEngine(BaseEngine): method __init__ (line 55) | def __init__( method decode (line 64) | def decode(self, z: torch.Tensor) -> torch.Tensor: method encode (line 67) | def encode(self, x: torch.Tensor) -> torch.Tensor: method cpu (line 71) | def cpu(self): method cuda (line 77) | def cuda(self): method to (line 83) | def to(self, device): method device_memory_size (line 90) | def device_memory_size(self): FILE: src/flux/trt/trt_config/base_trt_config.py class ModuleName (line 30) | class ModuleName(Enum): class TRTBaseConfig (line 42) | class TRTBaseConfig: method build_trt_engine (line 69) | def build_trt_engine( method from_args (line 174) | def from_args(cls, model_name: str, *args, **kwargs) -> Any: method get_input_profile (line 178) | def get_input_profile( method check_dims (line 209) | def check_dims(self, *args, **kwargs) -> None | tuple[int, int] | int: method _check_batch (line 213) | def _check_batch(self, batch_size): method __post_init__ (line 218) | def __post_init__(self): method _get_onnx_path (line 223) | def _get_onnx_path(self) -> str: method _get_engine_path (line 232) | def _get_engine_path(self) -> str: method _get_repo_id (line 240) | def _get_repo_id(model_name: str) -> str: function register_config (line 255) | def register_config(module_name: ModuleName, precision: str): function get_config (line 266) | def get_config(module_name: ModuleName, precision: str) -> TRTBaseConfig: FILE: src/flux/trt/trt_config/clip_trt_config.py class ClipConfig (line 25) | class ClipConfig(TRTBaseConfig): method from_args (line 35) | def from_args( method check_dims (line 48) | def check_dims(self, batch_size: int) -> None: method get_input_profile (line 51) | def get_input_profile( FILE: src/flux/trt/trt_config/t5_trt_config.py class T5Config (line 29) | class T5Config(TRTBaseConfig): method from_args (line 40) | def from_args( method check_dims (line 53) | def check_dims(self, batch_size: int) -> None: method get_input_profile (line 56) | def get_input_profile( method _get_onnx_path (line 74) | def _get_onnx_path(self) -> str: FILE: src/flux/trt/trt_config/transformer_trt_config.py class TransformerConfig (line 31) | class TransformerConfig(TRTBaseConfig): method from_args (line 57) | def from_args( method _get_onnx_path (line 87) | def _get_onnx_path(self) -> str: method _get_latent (line 99) | def _get_latent(image_dim: int, compression_factor: int) -> int: method _get_context_dim (line 103) | def _get_context_dim( method __post_init__ (line 118) | def __post_init__(self): method get_minmax_dims (line 160) | def get_minmax_dims( method check_dims (line 194) | def check_dims( method get_input_profile (line 219) | def get_input_profile( FILE: src/flux/trt/trt_config/vae_trt_config.py class VAEBaseConfig (line 25) | class VAEBaseConfig(TRTBaseConfig): method _get_latent_dim (line 38) | def _get_latent_dim(self, image_dim: int) -> int: method __post_init__ (line 41) | def __post_init__(self): method check_dims (line 46) | def check_dims( class VAEDecoderConfig (line 71) | class VAEDecoderConfig(VAEBaseConfig): method from_args (line 79) | def from_args( method get_minmax_dims (line 102) | def get_minmax_dims( method get_input_profile (line 128) | def get_input_profile( class VAEEncoderConfig (line 175) | class VAEEncoderConfig(VAEBaseConfig): method from_args (line 183) | def from_args(cls, model_name: str, **kwargs): method get_minmax_dims (line 206) | def get_minmax_dims( method get_input_profile (line 229) | def get_input_profile( FILE: src/flux/trt/trt_manager.py class TRTManager (line 46) | class TRTManager: method module_to_engine_class (line 48) | def module_to_engine_class(self) -> dict[ModuleName, type[Engine]]: method __init__ (line 57) | def __init__( method _parse_models_precisions (line 76) | def _parse_models_precisions( method _parse_custom_onnx_path (line 99) | def _parse_custom_onnx_path(custom_onnx_paths: str) -> dict[ModuleName... method _create_directories (line 128) | def _create_directories(engine_dir: str): method _get_trt_configs (line 132) | def _get_trt_configs( method _build_engine (line 179) | def _build_engine( method load_engines (line 211) | def load_engines( method _clean_memory (line 279) | def _clean_memory(): method init_runtime (line 283) | def init_runtime(self): method stop_runtime (line 290) | def stop_runtime(self): FILE: src/flux/util.py function ensure_hf_auth (line 27) | def ensure_hf_auth(): function prompt_for_hf_auth (line 45) | def prompt_for_hf_auth(): function get_checkpoint_path (line 64) | def get_checkpoint_path(repo_id: str, filename: str, env_var: str) -> Path: function download_onnx_models_for_trt (line 108) | def download_onnx_models_for_trt(model_name: str, trt_transformer_precis... function check_onnx_access_for_trt (line 201) | def check_onnx_access_for_trt(model_name: str, trt_transformer_precision... function track_usage_via_api (line 206) | def track_usage_via_api(name: str, n=1) -> None: function save_image (line 243) | def save_image( class ModelSpec (line 288) | class ModelSpec: function aspect_ratio_to_height_width (line 637) | def aspect_ratio_to_height_width(aspect_ratio: str, area: int = 1024**2)... function print_load_warning (line 646) | def print_load_warning(missing: list[str], unexpected: list[str]) -> None: function load_flow_model (line 657) | def load_flow_model(name: str, device: str | torch.device = "cuda", verb... function load_t5 (line 689) | def load_t5(device: str | torch.device = "cuda", max_length: int = 512) ... function load_clip (line 694) | def load_clip(device: str | torch.device = "cuda") -> HFEmbedder: function load_ae (line 698) | def load_ae(name: str, device: str | torch.device = "cuda") -> AutoEncoder: function optionally_expand_state_dict (line 714) | def optionally_expand_state_dict(model: torch.nn.Module, state_dict: dic... class WatermarkEmbedder (line 733) | class WatermarkEmbedder: method __init__ (line 734) | def __init__(self, watermark): method __call__ (line 740) | def __call__(self, image: torch.Tensor) -> torch.Tensor: