From 4bee0fa1991efe3ed88fc101376721e78df0b2f9 Mon Sep 17 00:00:00 2001 From: William Lin Date: Tue, 10 Feb 2026 02:26:09 -0800 Subject: [PATCH] [misc] cleanup assets/ and demo/ (#1091) --- .gitignore | 5 + .pre-commit-config.yaml | 2 +- AGENTS.md | 2 +- {images => assets/images}/80s_dance.jpg | Bin {images => assets/images}/bus_terminal.jpg | Bin {images => assets/images}/couple.jpg | Bin {images => assets/images}/cyclist.jpg | Bin {images => assets/images}/friends.jpg | Bin {images => assets/images}/gray_short_man.jpg | Bin {images => assets/images}/jazz.jpg | Bin ...ends-celebrate-new-years-eve-and-51525.png | Bin ...-cute-couple-playing-on-the-grass-4688.png | Bin ...s-through-the-forest-path-on-her-50088.png | Bin ...-rancher-riding-a-horse-at-sunset-1143.png | Bin ...-man-practicing-his-karate-moves-49635.png | Bin ...al-shot-of-a-beach-with-sea-waves-1087.png | Bin ...f-a-rocky-mountain-in-the-forest-50589.png | Bin ...climbing-a-huge-rock-in-a-desert-43306.png | Bin ...ying-low-over-a-lake-in-a-meadow-41417.png | Bin ...-skateboard-in-a-park-with-ramps-34389.png | Bin ...xkit-curve-on-a-snowy-forest-road-3317.png | Bin .../mixkit-dolphins-underwater-4133.png | Bin ...e-lake-with-turquoise-blue-waters-4996.png | Bin .../mixkit-skiers-on-a-snowy-slope-3327.png | Bin ...up-of-people-doing-yoga-together-43730.png | Bin ...cleaning-her-house-dancing-happy-43379.png | Bin {images => assets/images}/natural.jpg | Bin {images => assets/images}/peninsula.jpg | Bin {images => assets/images}/pink.jpg | Bin {images => assets/images}/romance.jpg | Bin {images => assets/images}/saxophonist.jpg | Bin {prompts => assets/prompts}/mixkit_i2v.jsonl | 54 ++--- {videos => assets/videos}/README.md | 2 +- {videos => assets/videos}/robot_pouring.mp4 | Bin demo/gradio_web_demo.py | 195 ------------------ demo/qualitative_results.md | 15 -- .../inference/basic/basic_cosmos2_5_i2w.py | 3 +- .../inference/basic/basic_cosmos2_5_v2w.py | 3 +- .../basic_self_forcing_causal_wan2_2_i2v.py | 2 +- .../gradio/serving/gradio_frontend.py | 15 +- scripts/preprocess/syn_text.slurm | 2 +- 41 files changed, 47 insertions(+), 253 deletions(-) rename {images => assets/images}/80s_dance.jpg (100%) rename {images => assets/images}/bus_terminal.jpg (100%) rename {images => assets/images}/couple.jpg (100%) rename {images => assets/images}/cyclist.jpg (100%) rename {images => assets/images}/friends.jpg (100%) rename {images => assets/images}/gray_short_man.jpg (100%) rename {images => assets/images}/jazz.jpg (100%) rename {images => assets/images}/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png (100%) rename {images => assets/images}/mixkit-a-cute-couple-playing-on-the-grass-4688.png (100%) rename {images => assets/images}/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png (100%) rename {images => assets/images}/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png (100%) rename {images => assets/images}/mixkit-a-young-man-practicing-his-karate-moves-49635.png (100%) rename {images => assets/images}/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png (100%) rename {images => assets/images}/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png (100%) rename {images => assets/images}/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png (100%) rename {images => assets/images}/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png (100%) rename {images => assets/images}/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png (100%) rename {images => assets/images}/mixkit-curve-on-a-snowy-forest-road-3317.png (100%) rename {images => assets/images}/mixkit-dolphins-underwater-4133.png (100%) rename {images => assets/images}/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png (100%) rename {images => assets/images}/mixkit-skiers-on-a-snowy-slope-3327.png (100%) rename {images => assets/images}/mixkit-small-group-of-people-doing-yoga-together-43730.png (100%) rename {images => assets/images}/mixkit-woman-cleaning-her-house-dancing-happy-43379.png (100%) rename {images => assets/images}/natural.jpg (100%) rename {images => assets/images}/peninsula.jpg (100%) rename {images => assets/images}/pink.jpg (100%) rename {images => assets/images}/romance.jpg (100%) rename {images => assets/images}/saxophonist.jpg (100%) rename {prompts => assets/prompts}/mixkit_i2v.jsonl (82%) rename {videos => assets/videos}/README.md (94%) rename {videos => assets/videos}/robot_pouring.mp4 (100%) delete mode 100644 demo/gradio_web_demo.py delete mode 100644 demo/qualitative_results.md diff --git a/.gitignore b/.gitignore index cd1f6e322..ca1d6d319 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,11 @@ docs/distillation/examples/ !docs/assets/images/**/*.png !comfyui/assets/**/*.png !comfyui/assets/**/*.gif +!assets/images/**/*.png +!assets/images/**/*.jpg +!assets/images/**/*.jpeg +!assets/images/**/*.gif +!assets/videos/**/*.mp4 dmd_t2v_output/ preprocess_output_text/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4c3771e8..62098b154 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ exclude: | demo/.*| predict\.py| scripts/.*| - prompts/.*| + assets/prompts/.*| fastvideo/data_preprocess/.*| fastvideo/dataset/.*| fastvideo/models/.*| diff --git a/AGENTS.md b/AGENTS.md index bf2221b23..221341d90 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ - `tests/local_tests/` for additional local/component checks. - Docs and guides: `docs/` (MkDocs source), with contributor docs in `docs/contributing/`. - Runnable examples and scripts: `examples/` and `scripts/`. -- Static assets: `assets/`, `images/`, `videos/`, and `comfyui/assets/`. +- Static assets: `assets/` (including `assets/images/`, `assets/videos/`, and `assets/prompts/`) and `comfyui/assets/`. ## Build, Test, and Development Commands - `uv pip install -e .[dev]`: editable install with lint/test extras. diff --git a/images/80s_dance.jpg b/assets/images/80s_dance.jpg similarity index 100% rename from images/80s_dance.jpg rename to assets/images/80s_dance.jpg diff --git a/images/bus_terminal.jpg b/assets/images/bus_terminal.jpg similarity index 100% rename from images/bus_terminal.jpg rename to assets/images/bus_terminal.jpg diff --git a/images/couple.jpg b/assets/images/couple.jpg similarity index 100% rename from images/couple.jpg rename to assets/images/couple.jpg diff --git a/images/cyclist.jpg b/assets/images/cyclist.jpg similarity index 100% rename from images/cyclist.jpg rename to assets/images/cyclist.jpg diff --git a/images/friends.jpg b/assets/images/friends.jpg similarity index 100% rename from images/friends.jpg rename to assets/images/friends.jpg diff --git a/images/gray_short_man.jpg b/assets/images/gray_short_man.jpg similarity index 100% rename from images/gray_short_man.jpg rename to assets/images/gray_short_man.jpg diff --git a/images/jazz.jpg b/assets/images/jazz.jpg similarity index 100% rename from images/jazz.jpg rename to assets/images/jazz.jpg diff --git a/images/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png b/assets/images/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png similarity index 100% rename from images/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png rename to assets/images/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png diff --git a/images/mixkit-a-cute-couple-playing-on-the-grass-4688.png b/assets/images/mixkit-a-cute-couple-playing-on-the-grass-4688.png similarity index 100% rename from images/mixkit-a-cute-couple-playing-on-the-grass-4688.png rename to assets/images/mixkit-a-cute-couple-playing-on-the-grass-4688.png diff --git a/images/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png b/assets/images/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png similarity index 100% rename from images/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png rename to assets/images/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png diff --git a/images/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png b/assets/images/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png similarity index 100% rename from images/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png rename to assets/images/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png diff --git a/images/mixkit-a-young-man-practicing-his-karate-moves-49635.png b/assets/images/mixkit-a-young-man-practicing-his-karate-moves-49635.png similarity index 100% rename from images/mixkit-a-young-man-practicing-his-karate-moves-49635.png rename to assets/images/mixkit-a-young-man-practicing-his-karate-moves-49635.png diff --git a/images/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png b/assets/images/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png similarity index 100% rename from images/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png rename to assets/images/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png diff --git a/images/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png b/assets/images/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png similarity index 100% rename from images/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png rename to assets/images/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png diff --git a/images/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png b/assets/images/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png similarity index 100% rename from images/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png rename to assets/images/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png diff --git a/images/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png b/assets/images/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png similarity index 100% rename from images/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png rename to assets/images/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png diff --git a/images/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png b/assets/images/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png similarity index 100% rename from images/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png rename to assets/images/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png diff --git a/images/mixkit-curve-on-a-snowy-forest-road-3317.png b/assets/images/mixkit-curve-on-a-snowy-forest-road-3317.png similarity index 100% rename from images/mixkit-curve-on-a-snowy-forest-road-3317.png rename to assets/images/mixkit-curve-on-a-snowy-forest-road-3317.png diff --git a/images/mixkit-dolphins-underwater-4133.png b/assets/images/mixkit-dolphins-underwater-4133.png similarity index 100% rename from images/mixkit-dolphins-underwater-4133.png rename to assets/images/mixkit-dolphins-underwater-4133.png diff --git a/images/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png b/assets/images/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png similarity index 100% rename from images/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png rename to assets/images/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png diff --git a/images/mixkit-skiers-on-a-snowy-slope-3327.png b/assets/images/mixkit-skiers-on-a-snowy-slope-3327.png similarity index 100% rename from images/mixkit-skiers-on-a-snowy-slope-3327.png rename to assets/images/mixkit-skiers-on-a-snowy-slope-3327.png diff --git a/images/mixkit-small-group-of-people-doing-yoga-together-43730.png b/assets/images/mixkit-small-group-of-people-doing-yoga-together-43730.png similarity index 100% rename from images/mixkit-small-group-of-people-doing-yoga-together-43730.png rename to assets/images/mixkit-small-group-of-people-doing-yoga-together-43730.png diff --git a/images/mixkit-woman-cleaning-her-house-dancing-happy-43379.png b/assets/images/mixkit-woman-cleaning-her-house-dancing-happy-43379.png similarity index 100% rename from images/mixkit-woman-cleaning-her-house-dancing-happy-43379.png rename to assets/images/mixkit-woman-cleaning-her-house-dancing-happy-43379.png diff --git a/images/natural.jpg b/assets/images/natural.jpg similarity index 100% rename from images/natural.jpg rename to assets/images/natural.jpg diff --git a/images/peninsula.jpg b/assets/images/peninsula.jpg similarity index 100% rename from images/peninsula.jpg rename to assets/images/peninsula.jpg diff --git a/images/pink.jpg b/assets/images/pink.jpg similarity index 100% rename from images/pink.jpg rename to assets/images/pink.jpg diff --git a/images/romance.jpg b/assets/images/romance.jpg similarity index 100% rename from images/romance.jpg rename to assets/images/romance.jpg diff --git a/images/saxophonist.jpg b/assets/images/saxophonist.jpg similarity index 100% rename from images/saxophonist.jpg rename to assets/images/saxophonist.jpg diff --git a/prompts/mixkit_i2v.jsonl b/assets/prompts/mixkit_i2v.jsonl similarity index 82% rename from prompts/mixkit_i2v.jsonl rename to assets/prompts/mixkit_i2v.jsonl index 71d4747f9..b0f1dbfb2 100644 --- a/prompts/mixkit_i2v.jsonl +++ b/assets/prompts/mixkit_i2v.jsonl @@ -1,110 +1,110 @@ [ { "prompt": "Young man skating with a skateboard on the ramps with graffiti of a park with trees, on a sunny day.", - "image_path": "images/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png" + "image_path": "assets/images/mixkit-boy-skating-with-a-skateboard-in-a-park-with-ramps-34389.png" }, { "prompt": "In the midst of the joyous New Year's Eve celebration, the cheerful group of friends, their spirits lifted by the festivities, decides to immortalize the moment with a vibrant snapshot", - "image_path": "images/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png" + "image_path": "assets/images/mixkit-a-cheerful-group-of-friends-celebrate-new-years-eve-and-51525.png" }, { "prompt": "A man and a woman playing in a field with grass, during a bright afternoon, while cars pass by in the distance.", - "image_path": "images/mixkit-a-cute-couple-playing-on-the-grass-4688.png" + "image_path": "assets/images/mixkit-a-cute-couple-playing-on-the-grass-4688.png" }, { "prompt": "Aerial view of a rocky mountain in the forest at a sunny day drone flight footage", - "image_path": "images/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png" + "image_path": "assets/images/mixkit-aerial-view-of-a-rocky-mountain-in-the-forest-50589.png" }, { "prompt": "A little girl wearing a pink security helmet and denim overall discovers the art of cycling amidst the serene park, as the camera captures her graceful progress.", - "image_path": "images/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png" + "image_path": "assets/images/mixkit-a-little-girl-cruises-through-the-forest-path-on-her-50088.png" }, { "prompt": "Aerial shot of a beach shore with sea waves. Big rocks on the sand at an alone beach.", - "image_path": "images/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png" + "image_path": "assets/images/mixkit-aerial-shot-of-a-beach-with-sea-waves-1087.png" }, { "prompt": "Young woman cleaning her house decorated with plants and decorations, while dancing happily to music in her headphones.", - "image_path": "images/mixkit-woman-cleaning-her-house-dancing-happy-43379.png" + "image_path": "assets/images/mixkit-woman-cleaning-her-house-dancing-happy-43379.png" }, { "prompt": "Aerial tour in a meadow surrounded by hills on the horizon, while some birds fly low over a lake.", - "image_path": "images/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png" + "image_path": "assets/images/mixkit-birds-flying-low-over-a-lake-in-a-meadow-41417.png" }, { "prompt": "In the video, a lone rider guides a majestic horse across an expansive, open field as the sun sets in the background. The rider, dressed in a classic blue shirt and wide-brimmed hat, sits confidently in the saddle, silhouetted against the warm glow of the evening sky. The horse moves gracefully, its mane and tail flowing with each step, creating a sense of harmony between horse and rider. Surrounding the pair, towering trees form a natural border, their leaves gently rustling in the breeze. The shadows lengthen on the ground, accentuating the serene and timeless feel of the scene. The distant hills and wooden fences frame the horizon, adding depth to the tranquil landscape. A few horses graze peacefully in the background, blending into the pastoral setting. The overall ambiance evokes a sense of calmness and quietude, capturing a perfect moment in the golden light of dusk.", - "image_path": "images/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png" + "image_path": "assets/images/mixkit-a-rancher-riding-a-horse-at-sunset-1143.png" }, { "prompt": "In the video, a martial artist dressed in a traditional white uniform with a black belt demonstrates a series of precise movements against a stark black background. The individual gracefully transitions between stances, embodying a sense of focused discipline and control. Each motion is executed with a deliberate pace, showcasing the fluidity of martial arts techniques. The soft lighting creates subtle highlights on the uniform, adding depth to the figure as it moves. The practitioner begins with an open-hand pose, feet firmly grounded, gradually shifting to a powerful forward punch. The fluidity of the sequence displays a mastery of balance and poise. Every trajectory of the limbs is precise and deliberate, capturing the elegance and strength of martial arts. The serene, isolated setting enhances the intensity and concentration of the practitioner. This visual presentation is an elegant interplay of motion and stillness, displaying the art form's discipline and grace.", - "image_path": "images/mixkit-a-young-man-practicing-his-karate-moves-49635.png" + "image_path": "assets/images/mixkit-a-young-man-practicing-his-karate-moves-49635.png" }, { "prompt": "In a serene and softly lit yoga studio, three individuals engage in a yoga session, each performing an upward-facing stretch. The central figure is a woman with shoulder-length brown hair, dressed in a light cropped top and green leggings, her posture reflecting grace and concentration. To her right, another participant, a woman in a purple outfit, mirrors the pose with equal poise. On her left, a person with a bun focuses intently, supported slightly by yoga blocks beneath their hands. The warm-colored wooden floor contrasts soothingly with the soft pastel mural on the back wall, featuring an abstract design and partial visage of a serene face. Natural light floods the space from a large window on the right, where lush greens peek through, adding an element of tranquility. In the corner of the room, a collection of meditation instruments, including a gong and a Buddha statue, subtly frame the peaceful setting. The mood is calm yet focused, as all three participants are deeply engaged in their practice. The scene combines elements of balance, harmony, and a shared journey towards mindfulness. This depiction captures the essence of a yoga session that blends personal growth with collective experience.", - "image_path": "images/mixkit-small-group-of-people-doing-yoga-together-43730.png" + "image_path": "assets/images/mixkit-small-group-of-people-doing-yoga-together-43730.png" }, { "prompt": "In the deep blue expanse of the ocean, two dolphins glide effortlessly, their sleek bodies reflecting the sunlight filtering through the water. The prominent shadows and caustics create a shimmering effect on their skin, capturing the beauty of their natural habitat. Each dolphin moves with a fluid grace, occasionally interacting with gentle nudges, showcasing their playful and social nature. The scene is vibrant and dynamic, with the clear blue background accentuating the dolphins' movements, making it an ideal subject for AI recreation.", - "image_path": "images/mixkit-dolphins-underwater-4133.png" + "image_path": "assets/images/mixkit-dolphins-underwater-4133.png" }, { "prompt": "A bustling ski slope comes alive with skiers descending a pristine, snow-covered hill, surrounded by towering, snow-draped evergreens. Several figures stand atop the slope, silhouetted against a clear blue sky, preparing to embark on their ski run. The chair lift on the right continuously drops off eager adventurers, adding to the excitement at the hilltop. Each skier, clad in colorful winter gear, carves distinct paths into the textured snow as they weave their way down. The interplay of sunlight and shadows accentuates the myriad tracks etched into the slope, creating a dynamic visual rhythm. The scene captures a vibrant winter wonderland, full of action and the thrill of a perfect ski day.", - "image_path": "images/mixkit-skiers-on-a-snowy-slope-3327.png" + "image_path": "assets/images/mixkit-skiers-on-a-snowy-slope-3327.png" }, { "prompt": "A determined climber is scaling a massive rock face, showcasing exceptional strength and skill. The person, clad in a teal shirt and dark pants, climbs with precision, their movements measured and deliberate. They are secured by climbing gear, which includes ropes and a harness, emphasizing their commitment to safety. The rugged texture of the sandy-colored rock provides an imposing backdrop, adding drama and scale to the climb. In the distance, other large rock formations and sparse vegetation can be seen under a bright, overcast sky, contributing to the natural and adventurous atmosphere. The scene captures a moment of focus and challenge, highlighting the climber's tenacity and the breathtaking environment.", - "image_path": "images/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png" + "image_path": "assets/images/mixkit-alpinist-climbing-a-huge-rock-in-a-desert-43306.png" }, { "prompt": "A silver SUV drives along a winding, snow-covered mountain road, with dense pine trees blanketed in snow lining both sides. The scene is serene, with the vehicle moving smoothly, possibly on a winter journey or vacation. As the SUV disappears around the bend, another, darker SUV follows, creating a sense of motion and perspective on the snow-dusted asphalt. The towering, snow-laden rock formation to the right contrasts with the dark green of the pines, highlighting the peacefulness of the wintry landscape.", - "image_path": "images/mixkit-curve-on-a-snowy-forest-road-3317.png" + "image_path": "assets/images/mixkit-curve-on-a-snowy-forest-road-3317.png" }, { "prompt": "A solitary boat glides across the expansive, tranquil expanse of a serene lake. The vessel leaves a gentle wake behind, creating delicate ripples across the mirror-like surface. The water appears a rich shade of teal, seamlessly blending with the sky at the horizon. Silhouettes of distant trees are faintly visible, creating a picturesque backdrop that enhances the solitary journey of the boat. The sky is a calm gradient, shifting from soft oranges near the shore to the pale blues above. In the distance, a few slender poles emerge from the water, remnants of an old structure or natural formation. The mood of the scene is one of peace and solitude, with the boat journeying steadily through the quiet landscape. There is a sense of endless possibilities as the boat moves toward the unseen beyond the frame. The simplicity and stillness of the scene invite contemplation and reflection, encapsulating a perfect moment of quietude on the water.", - "image_path": "images/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png" + "image_path": "assets/images/mixkit-motorboat-on-a-large-lake-with-turquoise-blue-waters-4996.png" }, { "prompt": "A man wearing grey shorts jumps rope in a gym, weights and gym equipment in the background.", - "image_path": "images/gray_short_man.jpg" + "image_path": "assets/images/gray_short_man.jpg" }, { "prompt": "Flying over a peninsula covered in bushy trees, while discovering the sea around it, painted a beautiful turquoise blue, on a sunny day.", - "image_path": "images/peninsula.jpg" + "image_path": "assets/images/peninsula.jpg" }, { "prompt": "Skillful cyclist doing a wheelie on a bike while riding through a forest, on a dirt road, surrounded by many trees, in the morning.", - "image_path": "images/cyclist.jpg" + "image_path": "assets/images/cyclist.jpg" }, { "prompt": "Some friends dancing and having fun together in circles, at a party surrounded by colored lights at a party, in a fancy old place, in a view from below them.", - "image_path": "images/friends.jpg" + "image_path": "assets/images/friends.jpg" }, { "prompt": "A saxophonist wearing a blazer dances while playing a song in a park.", - "image_path": "images/saxophonist.jpg" + "image_path": "assets/images/saxophonist.jpg" }, { "prompt": "Romantic couple embracing and looking at each other in the middle of a forest, during a break on a road trip through nature.", - "image_path": "images/romance.jpg" + "image_path": "assets/images/romance.jpg" }, { "prompt": "Man dressed in 80's style dances very happily in his kitchen while listening to music on his radio and drinking wine.", - "image_path": "images/80s_dance.jpg" + "image_path": "assets/images/80s_dance.jpg" }, { "prompt": "Pair of jazz musicians performing a song with their saxophone and trombone on an abandoned train.", - "image_path": "images/jazz.jpg" + "image_path": "assets/images/jazz.jpg" }, { "prompt": "A young woman with short hair wearing pink sunglasses chews gum and makes a bubble gum with the city in the background.", - "image_path": "images/pink.jpg" + "image_path": "assets/images/pink.jpg" }, { "prompt": "Natural aerial landscape with a relief covered with abundant trees and vegetation and a thick layer of mist.", - "image_path": "images/natural.jpg" + "image_path": "assets/images/natural.jpg" }, { "prompt": "Loving couple sitting on a log on the shore of a lake outside, sharing an affectionate hug.", - "image_path": "images/couple.jpg" + "image_path": "assets/images/couple.jpg" } ] diff --git a/videos/README.md b/assets/videos/README.md similarity index 94% rename from videos/README.md rename to assets/videos/README.md index d2615f4dd..92183bf28 100644 --- a/videos/README.md +++ b/assets/videos/README.md @@ -1,4 +1,4 @@ -# FastVideo/videos +# FastVideo/assets/videos This folder is used to store **video assets for examples**, primarily **input videos** consumed by scripts under `FastVideo/examples/`. diff --git a/videos/robot_pouring.mp4 b/assets/videos/robot_pouring.mp4 similarity index 100% rename from videos/robot_pouring.mp4 rename to assets/videos/robot_pouring.mp4 diff --git a/demo/gradio_web_demo.py b/demo/gradio_web_demo.py deleted file mode 100644 index f972bf5fe..000000000 --- a/demo/gradio_web_demo.py +++ /dev/null @@ -1,195 +0,0 @@ -import argparse -import os -import tempfile - -import gradio as gr -import torch -from diffusers import FlowMatchEulerDiscreteScheduler -from diffusers.utils import export_to_video - -from fastvideo.distill.solver import PCMFMScheduler -from fastvideo.models.mochi_hf.modeling_mochi import MochiTransformer3DModel -from fastvideo.models.mochi_hf.pipeline_mochi import MochiPipeline - - -def init_args(): - parser = argparse.ArgumentParser() - parser.add_argument("--prompts", nargs="+", default=[]) - parser.add_argument("--num_frames", type=int, default=25) - parser.add_argument("--height", type=int, default=480) - parser.add_argument("--width", type=int, default=848) - parser.add_argument("--num_inference_steps", type=int, default=8) - parser.add_argument("--guidance_scale", type=float, default=4.5) - parser.add_argument("--model_path", type=str, default="data/mochi") - parser.add_argument("--seed", type=int, default=12345) - parser.add_argument("--transformer_path", type=str, default=None) - parser.add_argument("--scheduler_type", type=str, default="pcm_linear_quadratic") - parser.add_argument("--lora_checkpoint_dir", type=str, default=None) - parser.add_argument("--shift", type=float, default=8.0) - parser.add_argument("--num_euler_timesteps", type=int, default=50) - parser.add_argument("--linear_threshold", type=float, default=0.1) - parser.add_argument("--linear_range", type=float, default=0.75) - parser.add_argument("--cpu_offload", action="store_true") - return parser.parse_args() - - -def load_model(args): - if args.scheduler_type == "euler": - scheduler = FlowMatchEulerDiscreteScheduler() - else: - linear_quadratic = True if "linear_quadratic" in args.scheduler_type else False - scheduler = PCMFMScheduler( - 1000, - args.shift, - args.num_euler_timesteps, - linear_quadratic, - args.linear_threshold, - args.linear_range, - ) - - if args.transformer_path: - transformer = MochiTransformer3DModel.from_pretrained(args.transformer_path) - else: - transformer = MochiTransformer3DModel.from_pretrained(args.model_path, subfolder="transformer/") - - pipe = MochiPipeline.from_pretrained(args.model_path, transformer=transformer, scheduler=scheduler) - pipe.enable_vae_tiling() - # pipe.to(device) - # if args.cpu_offload: - pipe.enable_sequential_cpu_offload() - return pipe - - -def generate_video( - prompt, - negative_prompt, - use_negative_prompt, - seed, - guidance_scale, - num_frames, - height, - width, - num_inference_steps, - randomize_seed=False, -): - if randomize_seed: - seed = torch.randint(0, 1000000, (1, )).item() - - generator = torch.Generator(device="cuda").manual_seed(seed) - - if not use_negative_prompt: - negative_prompt = None - - with torch.autocast("cuda", dtype=torch.bfloat16): - output = pipe( - prompt=[prompt], - negative_prompt=negative_prompt, - height=height, - width=width, - num_frames=num_frames, - num_inference_steps=num_inference_steps, - guidance_scale=guidance_scale, - generator=generator, - ).frames[0] - - output_path = os.path.join(tempfile.mkdtemp(), "output.mp4") - export_to_video(output, output_path, fps=30) - return output_path, seed - - -examples = [ - "A hand enters the frame, pulling a sheet of plastic wrap over three balls of dough placed on a wooden surface. The plastic wrap is stretched to cover the dough more securely. The hand adjusts the wrap, ensuring that it is tight and smooth over the dough. The scene focuses on the hand’s movements as it secures the edges of the plastic wrap. No new objects appear, and the camera remains stationary, focusing on the action of covering the dough.", - "A vintage train snakes through the mountains, its plume of white steam rising dramatically against the jagged peaks. The cars glint in the late afternoon sun, their deep crimson and gold accents lending a touch of elegance. The tracks carve a precarious path along the cliffside, revealing glimpses of a roaring river far below. Inside, passengers peer out the large windows, their faces lit with awe as the landscape unfolds.", - "A crowded rooftop bar buzzes with energy, the city skyline twinkling like a field of stars in the background. Strings of fairy lights hang above, casting a warm, golden glow over the scene. Groups of people gather around high tables, their laughter blending with the soft rhythm of live jazz. The aroma of freshly mixed cocktails and charred appetizers wafts through the air, mingling with the cool night breeze.", -] - -args = init_args() -pipe = load_model(args) -print("load model successfully") -with gr.Blocks() as demo: - gr.Markdown("# Fastvideo Mochi Video Generation Demo") - - with gr.Group(): - with gr.Row(): - prompt = gr.Text( - label="Prompt", - show_label=False, - max_lines=1, - placeholder="Enter your prompt", - container=False, - ) - run_button = gr.Button("Run", scale=0) - result = gr.Video(label="Result", show_label=False) - - with gr.Accordion("Advanced options", open=False): - with gr.Group(): - with gr.Row(): - height = gr.Slider( - label="Height", - minimum=256, - maximum=1024, - step=32, - value=args.height, - ) - width = gr.Slider(label="Width", minimum=256, maximum=1024, step=32, value=args.width) - - with gr.Row(): - num_frames = gr.Slider( - label="Number of Frames", - minimum=21, - maximum=163, - value=args.num_frames, - ) - guidance_scale = gr.Slider( - label="Guidance Scale", - minimum=1, - maximum=12, - value=args.guidance_scale, - ) - num_inference_steps = gr.Slider( - label="Inference Steps", - minimum=4, - maximum=100, - value=args.num_inference_steps, - ) - - with gr.Row(): - use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=False) - negative_prompt = gr.Text( - label="Negative prompt", - max_lines=1, - placeholder="Enter a negative prompt", - visible=False, - ) - - seed = gr.Slider(label="Seed", minimum=0, maximum=1000000, step=1, value=args.seed) - randomize_seed = gr.Checkbox(label="Randomize seed", value=True) - seed_output = gr.Number(label="Used Seed") - - gr.Examples(examples=examples, inputs=prompt) - - use_negative_prompt.change( - fn=lambda x: gr.update(visible=x), - inputs=use_negative_prompt, - outputs=negative_prompt, - ) - - run_button.click( - fn=generate_video, - inputs=[ - prompt, - negative_prompt, - use_negative_prompt, - seed, - guidance_scale, - num_frames, - height, - width, - num_inference_steps, - randomize_seed, - ], - outputs=[result, seed_output], - ) - -if __name__ == "__main__": - demo.queue(max_size=20).launch(server_name="0.0.0.0", server_port=7860) diff --git a/demo/qualitative_results.md b/demo/qualitative_results.md deleted file mode 100644 index bd0de273d..000000000 --- a/demo/qualitative_results.md +++ /dev/null @@ -1,15 +0,0 @@ -Fast-Hunyuan comparison with original Hunyuan, achieving an 8X diffusion speed boost with the FastVideo framework. - -https://github.com/user-attachments/assets/064ac1d2-11ed-4a0c-955b-4d412a96ef30 - -Fast-Mochi comparison with original Mochi, achieving an 8X diffusion speed boost with the FastVideo framework. - -https://github.com/user-attachments/assets/5fbc4596-56d6-43aa-98e0-da472cf8e26c - -Comparison between OpenAI Sora, original Hunyuan and FastHunyuan - -https://github.com/user-attachments/assets/d323b712-3f68-42b2-952b-94f6a49c4836 - -Comparison between original FastHunyuan, LLM-INT8 quantized FastHunyuan and NF4 quantized FastHunyuan - -https://github.com/user-attachments/assets/cf89efb5-5f68-4949-a085-f41c1ef26c94 \ No newline at end of file diff --git a/examples/inference/basic/basic_cosmos2_5_i2w.py b/examples/inference/basic/basic_cosmos2_5_i2w.py index 5cdb631fb..001d02096 100644 --- a/examples/inference/basic/basic_cosmos2_5_i2w.py +++ b/examples/inference/basic/basic_cosmos2_5_i2w.py @@ -20,7 +20,7 @@ def main(): sampling_param = SamplingParam.from_pretrained(model_path) # image2world example from official repo - image_path = "images/bus_terminal.jpg" + image_path = "assets/images/bus_terminal.jpg" prompt = ( "A nighttime city bus terminal gradually shifts from stillness to subtle movement. " @@ -48,4 +48,3 @@ def main(): if __name__ == "__main__": main() - diff --git a/examples/inference/basic/basic_cosmos2_5_v2w.py b/examples/inference/basic/basic_cosmos2_5_v2w.py index c10218b01..addac9b4e 100644 --- a/examples/inference/basic/basic_cosmos2_5_v2w.py +++ b/examples/inference/basic/basic_cosmos2_5_v2w.py @@ -20,7 +20,7 @@ def main(): sampling_param = SamplingParam.from_pretrained(model_path) # video2world example from official repo - video_path = "videos/robot_pouring.mp4" + video_path = "assets/videos/robot_pouring.mp4" prompt = ( "A robotic arm, primarily white with black joints and cables, is shown in a clean, modern indoor setting with a white tabletop. " @@ -51,4 +51,3 @@ def main(): if __name__ == "__main__": main() - diff --git a/examples/inference/basic/basic_self_forcing_causal_wan2_2_i2v.py b/examples/inference/basic/basic_self_forcing_causal_wan2_2_i2v.py index bec8575c4..d735d0540 100644 --- a/examples/inference/basic/basic_self_forcing_causal_wan2_2_i2v.py +++ b/examples/inference/basic/basic_self_forcing_causal_wan2_2_i2v.py @@ -31,7 +31,7 @@ def main(): sampling_param.height = 480 sampling_param.seed = 1000 - with open("prompts/mixkit_i2v.jsonl", "r") as f: + with open("assets/prompts/mixkit_i2v.jsonl", "r") as f: prompt_image_pairs = json.load(f) for prompt_image_pair in prompt_image_pairs: diff --git a/examples/inference/gradio/serving/gradio_frontend.py b/examples/inference/gradio/serving/gradio_frontend.py index 5108b866b..0843bc555 100644 --- a/examples/inference/gradio/serving/gradio_frontend.py +++ b/examples/inference/gradio/serving/gradio_frontend.py @@ -188,8 +188,9 @@ def load_example_prompts(): prompt_to_image = {} # Try to find the JSON file relative to project root possible_json_paths = [ - Path("prompts/mixkit_i2v.jsonl"), - Path(__file__).parent.parent.parent.parent / "prompts" / "mixkit_i2v.jsonl", + Path("assets/prompts/mixkit_i2v.jsonl"), + Path(__file__).resolve().parents[4] / "assets" / "prompts" / + "mixkit_i2v.jsonl", ] json_path = None for path in possible_json_paths: @@ -201,8 +202,8 @@ def load_example_prompts(): try: with open(json_path, "r", encoding='utf-8') as f: data = json.load(f) - # Get the project root directory (parent of prompts directory) - project_root = json_path.parent.parent + # Resolve paths relative to repository root. + project_root = Path(__file__).resolve().parents[4] for item in data: prompt_text = item.get("prompt", "").strip() image_path = item.get("image_path", "") @@ -736,8 +737,8 @@ def main(): allowed_paths=[ os.path.abspath("outputs"), os.path.abspath("fastvideo-logos"), - os.path.abspath("prompts"), - os.path.abspath("images"), + os.path.abspath("assets/prompts"), + os.path.abspath("assets/images"), os.path.abspath(tempfile.gettempdir()), os.path.abspath(os.path.join(tempfile.gettempdir(), "gradio")), ] @@ -747,4 +748,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/scripts/preprocess/syn_text.slurm b/scripts/preprocess/syn_text.slurm index 241b60693..009e330e4 100644 --- a/scripts/preprocess/syn_text.slurm +++ b/scripts/preprocess/syn_text.slurm @@ -53,7 +53,7 @@ for i in {1..8}; do # Calculate which file this GPU should process file_num=$((START_FILE + i - 1)) - DATA_MERGE_PATH="prompts/v2m_${file_num}.txt" + DATA_MERGE_PATH="assets/prompts/v2m_${file_num}.txt" # Create unique output directory based on node and GPU for text-only processing OUTPUT_DIR="data/test-text-preprocessing/Node_${NODE_ID}_GPU_${i}_File_${file_num}"