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'}
get_max_seq_len()
get_max_seq_len()
Returns the default maximum sequence length for the model.
Subclasses should determine whether this value can be overridden by
setting the --max-length (pipeline_config.model.max_length) flag.
-
Return type:
initialize()
classmethod initialize(pipeline_config, model_config=None)
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.
-
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