Python module
max.pipelines.architectures.qwen_image
Qwen-Image diffusion architecture for image generation.
QwenImageArchConfigβ
class max.pipelines.architectures.qwen_image.QwenImageArchConfig(*, pipeline_config)
Bases: ArchConfig
Pipeline-level config for QwenImage (implements ArchConfig; no KV cache).
-
Parameters:
-
pipeline_config (PipelineConfig)
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
QwenImageConfigβ
class max.pipelines.architectures.qwen_image.QwenImageConfig(*, config_file=None, section_name=None, patch_size=2, in_channels=64, out_channels=None, num_layers=60, attention_head_dim=128, num_attention_heads=24, joint_attention_dim=3584, guidance_embeds=False, axes_dims_rope=(16, 56, 56), rope_theta=10000, zero_cond_t=False, eps=1e-06, dtype=bfloat16, device=<factory>)
Bases: QwenImageConfigBase
-
Parameters:
-
- config_file (str | None)
- section_name (str | None)
- patch_size (int)
- in_channels (int)
- out_channels (int | None)
- num_layers (int)
- attention_head_dim (int)
- num_attention_heads (int)
- joint_attention_dim (int)
- guidance_embeds (bool)
- axes_dims_rope (tuple[int, ...])
- rope_theta (int)
- zero_cond_t (bool)
- eps (float)
- dtype (DType)
- device (DeviceRef)
generate()β
static generate(config_dict, encoding, devices)
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].
QwenImageConfigBaseβ
class max.pipelines.architectures.qwen_image.QwenImageConfigBase(*, config_file=None, section_name=None, patch_size=2, in_channels=64, out_channels=None, num_layers=60, attention_head_dim=128, num_attention_heads=24, joint_attention_dim=3584, guidance_embeds=False, axes_dims_rope=(16, 56, 56), rope_theta=10000, zero_cond_t=False, eps=1e-06, dtype=bfloat16, device=<factory>)
Bases: MAXModelConfigBase
-
Parameters:
-
- config_file (str | None)
- section_name (str | None)
- patch_size (int)
- in_channels (int)
- out_channels (int | None)
- num_layers (int)
- attention_head_dim (int)
- num_attention_heads (int)
- joint_attention_dim (int)
- guidance_embeds (bool)
- axes_dims_rope (tuple[int, ...])
- rope_theta (int)
- zero_cond_t (bool)
- eps (float)
- dtype (DType)
- device (DeviceRef)
attention_head_dimβ
attention_head_dim: int
axes_dims_ropeβ
deviceβ
device: DeviceRef
dtypeβ
dtype: DType
epsβ
eps: float
guidance_embedsβ
guidance_embeds: bool
in_channelsβ
in_channels: int
joint_attention_dimβ
joint_attention_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].
num_attention_headsβ
num_attention_heads: int
num_layersβ
num_layers: int
out_channelsβ
patch_sizeβ
patch_size: int
rope_thetaβ
rope_theta: int
zero_cond_tβ
zero_cond_t: bool
QwenImageTransformerModelβ
class max.pipelines.architectures.qwen_image.QwenImageTransformerModel(config, encoding, devices, weights, session)
Bases: ComponentModel
-
Parameters:
load_model()β
load_model()
Load and return a runtime model instance.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!