"""Publisher-derived Cosmos3 structured scene image on a GB200-class host."""
import json
from pathlib import Path
import torch
from diffusers import Cosmos3OmniPipeline
from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler

prompt = {
    "description": "A warehouse robot folds a blue cloth on a clean workbench.",
    "environment": "Bright industrial test cell with clear floor markings.",
    "camera": "Fixed wide three-quarter view showing robot, gripper and entire workbench.",
    "objects": ["blue cloth", "robot arm", "workbench"],
}
pipe = Cosmos3OmniPipeline.from_pretrained("nvidia/Cosmos3-Super-Text2Image", torch_dtype=torch.bfloat16, device_map="cuda", enable_safety_checker=True)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=3.0)
result = pipe(prompt=json.dumps(prompt), negative_prompt="", num_frames=1, height=1024, width=1024, num_inference_steps=50, guidance_scale=4.0, generator=torch.Generator(device="cuda").manual_seed(1143))
path = Path("cosmos3-physical-ai-scene.png")
result.video[0].save(path)
print(f"Saved {path}; inspect the geometry and object placement manually. This is not a physics simulation.")
