h3-blackwell-runtime/tools/submit_h3_capture_workflow.py
2026-08-12 14:12:42 +07:00

42 lines
2.8 KiB
Python

"""Submit a fixed 960x544 Ref2VA graph for direct-runner fixture capture."""
import json
import os
from urllib.request import Request, urlopen
prompt = {
"1": {"class_type": "UNETLoader", "inputs": {"unet_name": "minimax_h3_ref2va_pruned_nvfp4.safetensors", "weight_dtype": "default"}},
"3": {"class_type": "CLIPLoader", "inputs": {"clip_name": "qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors", "type": "minimax"}},
"4": {"class_type": "VAELoader", "inputs": {"vae_name": "minimax_h3_video_vae_fp16.safetensors"}},
"5": {"class_type": "VAELoader", "inputs": {"vae_name": "minimax_h3_audio_vae_fp32.safetensors"}},
"10": {"class_type": "RandomNoise", "inputs": {"noise_seed": int(os.environ.get("H3_CAPTURE_SEED", "440202"))}},
"11": {"class_type": "KSamplerSelect", "inputs": {"sampler_name": "res_multistep"}},
"12": {"class_type": "BasicScheduler", "inputs": {"model": ["1", 0], "scheduler": "beta", "steps": 12, "denoise": 1.0}},
"20": {"class_type": "LoadImage", "inputs": {"image": "episode-bees/01-desk_00001_.png"}},
"21": {"class_type": "LoadImage", "inputs": {"image": "episode-bees/02-launch_00001_.png"}},
"22": {"class_type": "LoadImage", "inputs": {"image": "episode-bees/03-flight_00001_.png"}},
"8": {
"class_type": "MiniMaxH3ReferenceToVideo",
"inputs": {
"clip": ["3", 0], "vae": ["4", 0], "audio_vae": ["5", 0],
"width": 960, "height": 544, "length": 124, "ref_image_size": "match",
"prompt": "Generate a continuous five-second storybook transition of a brass-and-paper dragon from a rainy clockmaker workshop to flight above a blue-hour city. Preserve the dragon identity and use clockwork, rain, wing flutter, and open night wind as the soundscape.",
"ref_images.ref_image_0": ["20", 0], "ref_images.ref_image_1": ["21", 0], "ref_images.ref_image_2": ["22", 0],
},
},
"9": {"class_type": "BasicGuider", "inputs": {"model": ["1", 0], "conditioning": ["8", 0]}},
"13": {"class_type": "SamplerCustomAdvanced", "inputs": {"noise": ["10", 0], "guider": ["9", 0], "sampler": ["11", 0], "sigmas": ["12", 0], "latent_image": ["8", 1]}},
"14": {"class_type": "VAEDecode", "inputs": {"samples": ["13", 0], "vae": ["4", 0]}},
"15": {"class_type": "VAEDecodeAudio", "inputs": {"samples": ["13", 0], "vae": ["5", 0]}},
"16": {"class_type": "CreateVideo", "inputs": {"images": ["14", 0], "audio": ["15", 0], "bit_depth": 8, "fps": 24.0}},
"17": {"class_type": "SaveVideo", "inputs": {"video": ["16", 0], "filename_prefix": "h3-blackwell-runtime/capture", "format": "mp4", "codec": "auto"}},
}
request = Request(
"http://localhost:8188/prompt",
data=json.dumps({"prompt": prompt}).encode(),
headers={"Content-Type": "application/json"},
)
with urlopen(request) as response:
print(response.read().decode())