vllm_omni.diffusion.models.cosmos3.transfer ¶
Cosmos3 transfer inference helpers.
The reference Cosmos Framework transfer path accepts one or more control hints and packs them before the noisy target video. This module keeps the vLLM Omni pipeline-specific pieces small: request parsing, media normalization, and optional on-the-fly edge/blur control generation.
Transfer is a video-output mode. It cannot be combined with T2I, sound generation, or action generation.
BLUR_DOWNUP_PRESETS module-attribute ¶
BLUR_DOWNUP_PRESETS: dict[str, int] = {
"none": 1,
"very_low": 4,
"low": 4,
"medium": 10,
"high": 16,
"very_high": 16,
}
BLUR_PRE_BLUR_DOWNSCALE_PRESETS module-attribute ¶
BLUR_PRE_BLUR_DOWNSCALE_PRESETS: dict[str, int] = {
"none": 1,
"very_low": 1,
"low": 4,
"medium": 2,
"high": 1,
"very_high": 4,
}
EDGE_PRESETS module-attribute ¶
EDGE_PRESETS: dict[str, tuple[int, int]] = {
"none": (20, 50),
"very_low": (20, 50),
"low": (50, 100),
"medium": (100, 200),
"high": (200, 300),
"very_high": (300, 400),
}
IMAGE_EXTENSIONS module-attribute ¶
TRANSFER_DEFAULTS module-attribute ¶
TRANSFER_DEFAULTS: dict[str, dict[str, Any]] = {
"edge": {
"guidance_scale": 3.0,
"control_guidance": 1.5,
"flow_shift": 10.0,
},
"blur": {
"guidance_scale": 3.0,
"control_guidance": 1.5,
"flow_shift": 10.0,
},
"depth": {
"guidance_scale": 3.0,
"control_guidance": 1.5,
"flow_shift": 10.0,
},
"seg": {
"guidance_scale": 3.0,
"control_guidance": 2.0,
"flow_shift": 10.0,
},
"wsm": {
"guidance_scale": 1.0,
"control_guidance": 3.0,
"flow_shift": 10.0,
"num_frames": 101,
"fps": 10,
"num_video_frames_per_chunk": 101,
},
}
TRANSFER_HINT_KEYS module-attribute ¶
TRANSFER_SAMPLE_DEFAULTS module-attribute ¶
TRANSFER_SAMPLE_DEFAULTS: dict[str, Any] = {
"num_video_frames_per_chunk": 93,
"num_conditional_frames": 1,
"max_frames": 5000,
"show_control_condition": False,
"show_input": False,
"num_first_chunk_conditional_frames": 0,
"share_vision_temporal_positions": True,
}
Cosmos3TransferConfig dataclass ¶
control_guidance_interval class-attribute instance-attribute ¶
hints class-attribute instance-attribute ¶
hints: dict[str, Cosmos3TransferHint] = field(
default_factory=dict
)
num_first_chunk_conditional_frames class-attribute instance-attribute ¶
num_first_chunk_conditional_frames: int = 0
num_video_frames_per_chunk class-attribute instance-attribute ¶
num_video_frames_per_chunk: int = 93
Cosmos3TransferHint dataclass ¶
load_or_compute_control_frames ¶
load_or_compute_control_frames(
hint: Cosmos3TransferHint,
*,
height: int,
width: int,
max_frames: int,
input_frames: Tensor | None,
) -> Tensor
media_to_uint8_cthw ¶
media_to_uint8_cthw(
value: Any,
*,
height: int,
width: int,
max_frames: int | None = None,
) -> Tensor
resize_center_crop_uint8_cthw ¶
resolve_transfer_config ¶
resolve_transfer_config(
sp: Any, prompt_data: Any = None
) -> Cosmos3TransferConfig | None