Skip to content

vllm_omni.diffusion.utils.hf_utils

DIFFUSION_MODEL_INDEX_FILES module-attribute

DIFFUSION_MODEL_INDEX_FILES = (
    "model_index.json",
    "modular_model_index.json",
)

HIDREAM_O1_SIGNATURE_WEIGHTS module-attribute

HIDREAM_O1_SIGNATURE_WEIGHTS = (
    "model.final_layer2.linear.weight",
    "final_layer2.linear.weight",
)

logger module-attribute

logger = init_logger(__name__)

get_diffusion_model_index

get_diffusion_model_index(
    model_name: str, *, revision: str | None = None
) -> dict | None

Read the first standard Diffusers pipeline index available.

is_diffusion_model cached

is_diffusion_model(model_name: str) -> bool

Check if a model is a diffusion model.

Uses multiple fallback strategies to detect diffusion models: 1. Check the local file system for a standard Diffusers index 2. Check using vllm's get_hf_file_to_dict utility 3. Try the standard diffusers approach (may fail due to import issues)

load_diffusers_config

load_diffusers_config(model_name) -> dict

resolve_native_diffusion_model_class

resolve_native_diffusion_model_class(
    model_name: str,
) -> str | None

Resolve native checkpoints that have no root HF or Diffusers config.