Skip to content

vllm_omni.model_extras.mammothmodal2_preview

MAMMOTHMODA2_PREVIEW_EXTRA_BODY_PARAMS module-attribute

MAMMOTHMODA2_PREVIEW_EXTRA_BODY_PARAMS = frozenset(
    {
        "text_guidance_scale",
        "cfg_range",
        "num_inference_steps",
    }
)

MAMMOTHMODA2_PREVIEW_EXTRA_OUTPUT_PARAMS module-attribute

MAMMOTHMODA2_PREVIEW_EXTRA_OUTPUT_PARAMS = frozenset()

MAMMOTHMODA2_PREVIEW_INIT_EXTRA_ARGS_FOR_NON_DIFFUSION_STAGES module-attribute

MAMMOTHMODA2_PREVIEW_INIT_EXTRA_ARGS_FOR_NON_DIFFUSION_STAGES = True

build_text_to_image_prompt

build_text_to_image_prompt(
    prompt: str,
    negative_prompt: str | None,
    height: int | None = None,
    width: int | None = None,
) -> dict[str, Any]

Build the MammothModa2 AR-stage prompt for text-to-image generation.

Reproduces the prompt string and the structural additional_information that the former bespoke example (run_mammothmoda2_t2i.py) constructed, deriving the AR image grid from height / width.

Model-specific sampling knobs (text_guidance_scale, cfg_range, num_inference_steps) flow separately via extra_body -> extra_args. The structural token ids are included in additional_information so the AR sampler can apply the same constraints for both Preview and Dev.

MammothModa2 t2i uses classifier-free guidance via text_guidance_scale and has no explicit negative-prompt path, so negative_prompt is accepted for signature compatibility but not injected.

build_x_to_text_prompt

build_x_to_text_prompt(
    model: str, prompt: str, has_image: bool
) -> tuple[dict[str, Any], list[int] | None]

Build MammothModa2's chat prompt for text-output tasks.