For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python module
max.pipelines.architectures.ideogram4
Ideogram 4 flow-matching text-to-image architecture.
Ideogram4ArchConfig
class max.pipelines.architectures.ideogram4.Ideogram4ArchConfig(*, pipeline_config: 'PipelineConfig', quantization_encoding: 'SupportedEncoding | None' = None)
Bases: ArchConfig
-
Parameters:
-
- pipeline_config (PipelineConfig)
- quantization_encoding (SupportedEncoding | None)
DEFAULT_ENCODING
DEFAULT_ENCODING: ClassVar[SupportedEncoding] = 'bfloat16'
SUPPORTED_ENCODINGS
SUPPORTED_ENCODINGS: ClassVar[set[SupportedEncoding]] = {'bfloat16'}
calculate_max_seq_len()
classmethod calculate_max_seq_len(huggingface_config, model_config)
Returns the resolved maximum sequence length.
Bounds or defaults the user’s model_config.max_length with the
model’s own limits. Construction runs this once and stores the
result on model_config.max_length; memory planning may lower
it further, but only on the memory plan.
-
Parameters:
-
- huggingface_config (AutoConfig) – The HuggingFace config to read model bounds from.
- model_config (MAXModelConfig) – The model config whose
max_lengthcarries the user’s setting.
-
Return type:
get_max_seq_len()
get_max_seq_len()
Returns the effective maximum sequence length for the model.
For configs that store a deployment length, this is the value
initialize received; for metadata-only configs it derives from
the checkpoint.
-
Return type:
initialize()
classmethod initialize(pipeline_config, model_config=None, *, max_seq_len)
Initialize the config from a PipelineConfig.
-
Parameters:
-
- pipeline_config (PipelineConfig) – The pipeline configuration.
- model_config (MAXModelConfig | None) – The model configuration to read from. When
None(the default),pipeline_config.modelis used. Pass an explicit config (e.g.pipeline_config.draft_model) to initialize the arch config for a different model. - max_seq_len (int) – The effective maximum sequence length to store on
the config. The value is received, never derived here: the
pipeline model passes the memory plan’s VRAM-clamped length,
while memory planning (which runs before a plan exists)
passes the construction-resolved
model_config.max_length. Configs whose sequence length is pure model metadata (e.g. diffusion components) ignore it.
-
Return type:
pipeline_config
pipeline_config: PipelineConfig
quantization_encoding
quantization_encoding: SupportedEncoding | None = None
Ideogram4Config
class max.pipelines.architectures.ideogram4.Ideogram4Config(*, config_file=None, section_name=None, emb_dim=4608, num_layers=34, num_heads=18, intermediate_size=12288, adaln_dim=512, norm_eps=1e-05, in_channels=128, llm_features_dim=53248, rope_theta=5000000.0, mrope_section=(24, 20, 20), dtype=bfloat16, device=<factory>)
Bases: MAXModelConfigBase
Architecture parameters for Ideogram4Transformer2DModel.
Defaults mirror ideogram-ai/ideogram-4-fp8 transformer/config.json
and the reference ideogram4.modeling_ideogram4.Ideogram4Config.
-
Parameters:
adaln_dim
adaln_dim: int
device
device: DeviceRef
dtype
dtype: DType
emb_dim
emb_dim: int
head_dim
property head_dim: int
in_channels
in_channels: int
initialize_from_config()
classmethod initialize_from_config(config_dict, encoding, devices)
intermediate_size
intermediate_size: int
llm_features_dim
llm_features_dim: int
model_config
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'strict': False}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
mrope_section
norm_eps
norm_eps: float
num_heads
num_heads: int
num_layers
num_layers: int
rope_theta
rope_theta: float
Ideogram4Transformer2DModel
class max.pipelines.architectures.ideogram4.Ideogram4Transformer2DModel(config)
Bases: Module
Ideogram 4 flow-matching transformer producing velocity predictions.
-
Parameters:
-
config (Ideogram4Config)
forward()
forward(*args)
Defines the computation performed by the module.
Users must override this method in their subclass to define the module’s computation.
-
Parameters:
-
- *args (Tensor) – Positional arguments for the computation.
- **kwargs – Keyword arguments for the computation.
-
Returns:
-
The result of applying the module to the input.
-
Raises:
-
NotImplementedError – If the subclass does not override this method.
-
Return type:
input_types()
input_types()
-
Return type:
-
tuple[TensorType, …]
Ideogram4TransformerModel
class max.pipelines.architectures.ideogram4.Ideogram4TransformerModel(config, encoding, devices, weights)
Bases: ComponentModel
Loads + adapts one Ideogram 4 DiT checkpoint (cond or uncond branch).
-
Parameters:
load_model()
load_model()
Adapt the checkpoint into a bf16 state dict (no standalone compile).
The actual graph compilation happens once in the pipeline, where both branches are fused into a single denoise-step graph.
-
Return type:
-
None