4545- ``cosmos3-super-4gpu.yaml`` — 4 GPU, CFG + Ulysses + parallel VAE
4646
4747Usage:
48- python cosmos3_ti2v.py --model nvidia/Cosmos3-Nano \\
48+ python cosmos3_ti2v.py --model nvidia/Cosmos3-Nano \
4949 --prompt "The video opens with a view of a well-lit indoor space featuring a " \\
5050 "wooden display case with compartments filled with various fruits, " \\
5151 "including bananas, apples, pears, oranges, and carambolas. " \\
6666 "position, leaving the display case and surrounding area unchanged. " \\
6767 "The video showcases a seamless and efficient automated fruit-picking " \\
6868 "process, highlighting the precision and efficiency of modern robotics " \\
69- "in a retail setting." \\
69+ "in a retail setting." \
7070 --visual_gen_args ../configs/cosmos3-nano-1gpu.yaml
71+
72+ python cosmos3_ti2v.py --model nvidia/Cosmos3-Nano \
73+ --prompt "A low-angle tracking shot follows a man riding a vintage black motorcycle " \\
74+ "across a lush green grassy yard. Sunlight filters through overhead trees, casting " \\
75+ "dappled shadows across the vibrating chrome exhaust and the rider's leather jacket. " \\
76+ "He kicks up small blades of grass as he maneuvers the bike. He gradually decelerates, " \\
77+ "the front fork compressing slightly as he brakes to a smooth halt beside another " \\
78+ "individual standing in the shade. The camera settles into a medium two-shot, capturing " \\
79+ "the rider lifting his visor to speak, his face framed by a matte helmet. The video is " \\
80+ "8 seconds long and is of 24 FPS. This video is of 1280x720 resolution. Audio description: " \\
81+ "The rhythmic, mechanical chugging of a four-stroke motorcycle engine dominates the " \\
82+ "foreground, characterized by a throaty, guttural timbre. Periodic high-pitched revs " \\
83+ "punctuate the steady idle as the throttle is twisted. The sound of tires crunching " \\
84+ "softly over dry grass and twigs provides a textured background layer. As the vehicle " \\
85+ "slows, the engine note drops to a low-frequency rumble before clicking into neutral. " \\
86+ "A muffled, mid-range male voice begins speaking, accompanied by the metallic clink of " \\
87+ "a helmet visor snapping upward and the faint chirping of distant birds in an open-air " \\
88+ "environment." \
89+ --visual_gen_args ../configs/cosmos3-nano-1gpu.yaml \
90+ --enable_audio
91+
92+ python cosmos3_ti2v.py --model nvidia/Cosmos3-Nano \
93+ --prompt "A cute puppy playing with a ball in a park" \
94+ --visual_gen_args ../configs/cosmos3-nano-1gpu.yaml \
95+ --output_type image \
96+ --output_path output.png
7197"""
7298
7399import argparse
100+ import json
74101
75102from tensorrt_llm import VisualGen , VisualGenArgs
76103
@@ -109,6 +136,26 @@ def main():
109136 default = "cosmos3_ti2v_output.mp4" ,
110137 help = "Path to save the output video" ,
111138 )
139+ parser .add_argument (
140+ "--enable_duration_template" , action = "store_true" , help = "Enable duration template in prompt"
141+ )
142+ parser .add_argument (
143+ "--enable_resolution_template" ,
144+ action = "store_true" ,
145+ help = "Enable resolution template in prompt" ,
146+ )
147+ parser .add_argument (
148+ "--use_system_prompt" , action = "store_true" , help = "Use system prompt in prompt"
149+ )
150+ parser .add_argument ("--enable_audio" , action = "store_true" , help = "Enable audio generation" )
151+ parser .add_argument (
152+ "--output_type" , type = str , default = "video" , help = "Output type (video, image)"
153+ )
154+
155+ # Guardrails
156+ parser .add_argument (
157+ "--disable_guardrails" , action = "store_true" , help = "NOT RECOMMENDED: Disable guardrails"
158+ )
112159 args = parser .parse_args ()
113160
114161 # Engine config from shared YAML (optional); model-specific defaults apply otherwise.
@@ -121,13 +168,25 @@ def main():
121168 if args .image_path is not None :
122169 params .image = args .image_path
123170
171+ negative_prompt = json .load (open ("neg_prompt.json" ))
172+
173+ params .extra_params ["use_duration_template" ] = args .enable_duration_template
174+ params .extra_params ["use_resolution_template" ] = args .enable_resolution_template
175+ params .extra_params ["use_system_prompt" ] = args .use_system_prompt
176+ params .extra_params ["enable_audio" ] = args .enable_audio
177+ params .extra_params ["use_guardrails" ] = not args .disable_guardrails
178+ params .extra_params ["output_type" ] = args .output_type
179+
180+ params .negative_prompt = json .dumps (negative_prompt )
181+
124182 output = visual_gen .generate (
125183 inputs = args .prompt ,
126184 params = params ,
127185 )
128186
129187 output .save (args .output_path )
130188 print (f"Saved: { args .output_path } " )
189+ print (output .metrics )
131190
132191
133192if __name__ == "__main__" :
0 commit comments