Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/black-forest-labs/flux
/ functions
Functions
217 in github.com/black-forest-labs/flux
⨍
Functions
217
◇
Types & classes
54
↓ 97 callers
Method
to
(self, device: str | torch.device)
src/flux/trt/engine/base_engine.py:182
↓ 43 callers
Method
cpu
(self)
src/flux/trt/engine/base_engine.py:160
↓ 8 callers
Method
__init__
(self, dim: int)
src/flux/modules/layers.py:76
↓ 8 callers
Method
decode
(self, z: torch.Tensor)
src/flux/trt/engine/vae_engine.py:64
↓ 8 callers
Function
denoise
( model: Flux, # model input img: Tensor, img_ids: Tensor, txt: Tensor, txt_ids: Tenso
src/flux/sampling.py:308
↓ 8 callers
Function
get_noise
( num_samples: int, height: int, width: int, device: torch.device, dtype: torch.dtype,
src/flux/sampling.py:17
↓ 8 callers
Function
get_schedule
( num_steps: int, image_seq_len: int, base_shift: float = 0.5, max_shift: float = 1.15, sh
src/flux/sampling.py:289
↓ 8 callers
Function
load_ae
(name: str, device: str | torch.device = "cuda")
src/flux/util.py:698
↓ 8 callers
Function
load_clip
(device: str | torch.device = "cuda")
src/flux/util.py:694
↓ 8 callers
Function
load_flow_model
(name: str, device: str | torch.device = "cuda", verbose: bool = True)
src/flux/util.py:657
↓ 8 callers
Function
load_t5
(device: str | torch.device = "cuda", max_length: int = 512)
src/flux/util.py:689
↓ 8 callers
Method
resize
(self, name: str, size: int)
src/flux/trt/engine/base_engine.py:48
↓ 8 callers
Function
unpack
(x: Tensor, height: int, width: int)
src/flux/sampling.py:356
↓ 7 callers
Method
__init__
( self, resolution: int, in_channels: int, ch: int, ch_mult: list[int]
src/flux/modules/autoencoder.py:110
↓ 7 callers
Method
_get_context_dim
( image_height: int, image_width: int, compression_factor: int, )
src/flux/trt/trt_config/transformer_trt_config.py:103
↓ 7 callers
Method
encode
(self, x: torch.Tensor)
src/flux/trt/engine/vae_engine.py:67
↓ 6 callers
Method
_get_latent_dim
(self, image_dim: int)
src/flux/trt/trt_config/vae_trt_config.py:38
↓ 6 callers
Function
prepare
(t5: HFEmbedder, clip: HFEmbedder, img: Tensor, prompt: str | list[str])
src/flux/sampling.py:36
↓ 6 callers
Method
trt_datatype_to_torch
(datatype)
src/flux/trt/engine/base_engine.py:101
↓ 5 callers
Function
clear_canvas_state
Clear all canvas-related state
demo_st_fill.py:116
↓ 5 callers
Method
get_dtype
(self, tensor_name: str)
src/flux/trt/engine/base_engine.py:220
↓ 5 callers
Method
infer
( self, feed_dict: dict[str, torch.Tensor], )
src/flux/trt/engine/base_engine.py:280
↓ 5 callers
Function
parse_img_cond_path
(options: SamplingOptions | None)
src/flux/cli_kontext.py:108
↓ 5 callers
Function
parse_prompt
(options: SamplingOptions)
src/flux/cli_kontext.py:34
↓ 5 callers
Function
save_image
( nsfw_classifier, name: str, output_name: str, idx: int, x: torch.Tensor, add_samplin
src/flux/util.py:243
↓ 4 callers
Method
_check_batch
(self, batch_size)
src/flux/trt/trt_config/base_trt_config.py:213
↓ 4 callers
Function
get_checkpoint_path
Get the local path for a checkpoint file, downloading if necessary.
src/flux/util.py:64
↓ 4 callers
Function
print_load_warning
(missing: list[str], unexpected: list[str])
src/flux/util.py:646
↓ 4 callers
Method
set_scale
(self, scale: float)
src/flux/modules/lora.py:84
↓ 4 callers
Function
swish
(x: Tensor)
src/flux/modules/autoencoder.py:21
↓ 4 callers
Function
track_usage_via_api
Track usage of licensed models via the BFL API for commercial licensing compliance. For more information on licensing BFL's models for comme
src/flux/util.py:206
↓ 3 callers
Method
_clean_memory
()
src/flux/trt/trt_manager.py:279
↓ 3 callers
Method
_get_repo_id
(model_name: str)
src/flux/trt/trt_config/base_trt_config.py:240
↓ 3 callers
Function
attention
(q: Tensor, k: Tensor, v: Tensor, pe: Tensor)
src/flux/math.py:6
↓ 3 callers
Method
load_engines
( self, model_name: str, module_names: set[ModuleName], engine_dir: str,
src/flux/trt/trt_manager.py:211
↓ 3 callers
Function
set_new_image
Safely set a new image and clear relevant state
demo_st_fill.py:124
↓ 2 callers
Method
__init__
( self, decoder: VAEDecoder, encoder: VAEEncoder | None = None, )
src/flux/trt/engine/vae_engine.py:55
↓ 2 callers
Method
_get_latent
(image_dim: int, compression_factor: int)
src/flux/trt/trt_config/transformer_trt_config.py:99
↓ 2 callers
Function
aspect_ratio_to_height_width
(aspect_ratio: str, area: int = 1024**2)
src/flux/util.py:637
↓ 2 callers
Method
calculate_input_hash
(feed_dict: Dict[str, torch.Tensor])
src/flux/trt/engine/base_engine.py:267
↓ 2 callers
Method
check_dims
( self, batch_size: int, image_height: int, image_width: int, )
src/flux/trt/trt_config/vae_trt_config.py:46
↓ 2 callers
Function
check_onnx_access_for_trt
Check ONNX access and download models for TRT - returns ONNX directory path
src/flux/util.py:201
↓ 2 callers
Function
parse_img_cond_path
(options: SamplingOptions | None)
src/flux/cli_fill.py:73
↓ 2 callers
Function
parse_img_cond_path
(options: SamplingOptions | None)
src/flux/cli_control.py:95
↓ 2 callers
Function
parse_img_cond_path
(options: SamplingOptions | None)
src/flux/cli_redux.py:99
↓ 2 callers
Function
parse_img_mask_path
(options: SamplingOptions | None)
src/flux/cli_fill.py:119
↓ 2 callers
Function
parse_lora_scale
(options: SamplingOptions | None)
src/flux/cli_control.py:134
↓ 2 callers
Function
parse_prompt
(options: SamplingOptions)
src/flux/cli.py:35
↓ 2 callers
Function
parse_prompt
(options: SamplingOptions)
src/flux/cli_fill.py:28
↓ 2 callers
Function
parse_prompt
(options: SamplingOptions)
src/flux/cli_control.py:28
↓ 2 callers
Function
parse_prompt
(options: SamplingOptions)
src/flux/cli_redux.py:34
↓ 2 callers
Function
prepare_fill
( t5: HFEmbedder, clip: HFEmbedder, img: Tensor, prompt: str | list[str], ae: AutoEncoder,
src/flux/sampling.py:107
↓ 2 callers
Method
stop_runtime
(self)
src/flux/trt/trt_manager.py:290
↓ 2 callers
Method
test_image
(self, image: Image.Image | str | torch.Tensor)
src/flux/content_filters.py:92
↓ 2 callers
Function
timestep_embedding
Create sinusoidal timestep embeddings. :param t: a 1-D Tensor of N indices, one per batch element. These may be fractio
src/flux/modules/layers.py:28
↓ 2 callers
Method
to
(self, device)
src/flux/trt/engine/vae_engine.py:83
↓ 1 callers
Method
__init__
(self, params: FluxParams)
src/flux/model.py:39
↓ 1 callers
Method
__init__
( self, trt_config: TRTBaseConfig, stream: torch.cuda.Stream, context_memory:
src/flux/trt/engine/base_engine.py:131
↓ 1 callers
Method
__init__
(self, device)
src/flux/modules/image_embedders.py:16
↓ 1 callers
Method
_build_engine
( trt_config: TRTBaseConfig, batch_size: int, image_height: int | None, image_
src/flux/trt/trt_manager.py:179
↓ 1 callers
Method
_create_directories
(engine_dir: str)
src/flux/trt/trt_manager.py:128
↓ 1 callers
Method
_get_engine_path
(self)
src/flux/trt/trt_config/base_trt_config.py:232
↓ 1 callers
Method
_get_onnx_path
(self)
src/flux/trt/trt_config/base_trt_config.py:223
↓ 1 callers
Method
_get_trt_configs
( self, model_name: str, module_names: set[ModuleName], engine_dir: str,
src/flux/trt/trt_manager.py:132
↓ 1 callers
Method
_parse_custom_onnx_path
Parse a string of comma-separated key-value pairs into a dictionary. Args: string (str): A string of comma-separated key-value pa
src/flux/trt/trt_manager.py:99
↓ 1 callers
Method
_parse_models_precisions
( trt_transformer_precision: str, trt_t5_precision: str )
src/flux/trt/trt_manager.py:76
↓ 1 callers
Function
add_border_and_mask
Adds a black border around the image with individual side control and mask overlap
demo_st_fill.py:31
↓ 1 callers
Function
app
()
demo_st.py:292
↓ 1 callers
Function
app
()
demo_st_fill.py:497
↓ 1 callers
Function
apply_rope
(xq: Tensor, xk: Tensor, freqs_cis: Tensor)
src/flux/math.py:25
↓ 1 callers
Method
attention
(self, h_: Tensor)
src/flux/modules/autoencoder.py:37
↓ 1 callers
Method
build_trt_engine
Metod used to build a TRT engine from a given set of flags or configurations using polygraphy. Args: engine_path (str):
src/flux/trt/trt_config/base_trt_config.py:69
↓ 1 callers
Method
check_dims
(self, batch_size: int)
src/flux/trt/trt_config/clip_trt_config.py:48
↓ 1 callers
Method
check_dims
( self, batch_size: int, image_height: int, image_width: int, )
src/flux/trt/trt_config/transformer_trt_config.py:194
↓ 1 callers
Method
check_dims
(self, batch_size: int)
src/flux/trt/trt_config/t5_trt_config.py:53
↓ 1 callers
Function
create_demo
( model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu", offload: bool = F
demo_gr.py:175
↓ 1 callers
Method
cuda
(self)
src/flux/trt/engine/base_engine.py:171
↓ 1 callers
Method
deactivate
(self)
src/flux/trt/engine/base_engine.py:194
↓ 1 callers
Method
decode
(self, z: Tensor)
src/flux/modules/autoencoder.py:313
↓ 1 callers
Function
download_onnx_models_for_trt
Download ONNX models for TRT to our checkpoints directory
src/flux/util.py:108
↓ 1 callers
Function
downscale_image
Downscale image by a given factor while maintaining 32-pixel multiple dimensions
demo_st_fill.py:131
↓ 1 callers
Method
encode
(self, x: Tensor)
src/flux/modules/autoencoder.py:308
↓ 1 callers
Function
ensure_hf_auth
()
src/flux/util.py:27
↓ 1 callers
Method
from_args
( cls, model_name: str, **kwargs, )
src/flux/trt/trt_config/t5_trt_config.py:40
↓ 1 callers
Function
get_config
Retrieve the appropriate configuration instance based on current flags.
src/flux/trt/trt_config/base_trt_config.py:266
↓ 1 callers
Function
get_image
()
demo_st.py:41
↓ 1 callers
Method
get_input_profile
( self, batch_size: int, image_height=None, image_width=None, )
src/flux/trt/trt_config/t5_trt_config.py:56
↓ 1 callers
Function
get_lin_function
( x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15 )
src/flux/sampling.py:281
↓ 1 callers
Method
get_minmax_dims
( self, batch_size: int, image_height: int, image_width: int, )
src/flux/trt/trt_config/vae_trt_config.py:102
↓ 1 callers
Method
get_minmax_dims
( self, batch_size: int, image_height: int, image_width: int, )
src/flux/trt/trt_config/vae_trt_config.py:206
↓ 1 callers
Method
get_minmax_dims
( self, batch_size: int, image_height: int, image_width: int, )
src/flux/trt/trt_config/transformer_trt_config.py:160
↓ 1 callers
Function
get_models
(name: str, device: torch.device, offload: bool, is_schnell: bool)
demo_st.py:32
↓ 1 callers
Function
get_models
(name: str, device: torch.device, offload: bool, is_schnell: bool)
demo_gr.py:27
↓ 1 callers
Function
get_models
(name: str, device: torch.device, offload: bool)
demo_st_fill.py:83
↓ 1 callers
Method
init_runtime
(self)
src/flux/trt/trt_manager.py:283
↓ 1 callers
Function
optionally_expand_state_dict
Optionally expand the state dict to match the model's parameters shapes.
src/flux/util.py:714
↓ 1 callers
Method
override_shapes
(self, feed_dict: Dict[str, torch.Tensor])
src/flux/trt/engine/base_engine.py:223
↓ 1 callers
Function
prepare_control
( t5: HFEmbedder, clip: HFEmbedder, img: Tensor, prompt: str | list[str], ae: AutoEncoder,
src/flux/sampling.py:70
↓ 1 callers
Function
prepare_kontext
( t5: HFEmbedder, clip: HFEmbedder, prompt: str | list[str], ae: AutoEncoder, img_cond_pat
src/flux/sampling.py:210
↓ 1 callers
Function
prepare_redux
( t5: HFEmbedder, clip: HFEmbedder, img: Tensor, prompt: str | list[str], encoder: ReduxIm
src/flux/sampling.py:160
next →
1–100 of 217, ranked by callers