-
Notifications
You must be signed in to change notification settings - Fork 522
Add video-to-video task #1772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MrShahzebKhoso
wants to merge
29
commits into
huggingface:main
Choose a base branch
from
MrShahzebKhoso:add-video-to-video-task
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add video-to-video task #1772
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
0b511a2
Add video-to-video task new folder
MrShahzebKhoso b1d33e5
Add video-to-video task added draft about.md, data.ts
MrShahzebKhoso e217222
Add video-to-video task
MrShahzebKhoso 50c695c
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 7a444c1
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 6ef0915
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso a8fb791
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso adc61bd
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 21ed0a0
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso 88182f2
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso 26cc86c
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso ad9f2eb
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso f9fc4b9
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso 418bd48
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso aeed0f4
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso 9ab6da4
Update packages/tasks/src/tasks/video-to-video/data.ts
MrShahzebKhoso ae71347
Update packages/tasks/src/tasks/video-to-video/data.ts
MrShahzebKhoso 663b190
Update packages/tasks/src/tasks/video-to-video/about.md
MrShahzebKhoso aa18356
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 4dc3af8
Updated about.md and data.ts as per the reviews.
MrShahzebKhoso e29d0c4
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 52652df
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 75dc328
Linked video-to-video task in index.ts
MrShahzebKhoso b384ad4
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 1008eb2
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso ebf8b9b
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 5275d2f
updated about.md and data.ts as per the review.
MrShahzebKhoso ac1f296
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso 882978f
Merge branch 'main' into add-video-to-video-task
MrShahzebKhoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
## Use Cases | ||
|
||
### Video Style Transfer | ||
Apply artistic or cinematic styles to a video while preserving motion and structure. For example, convert real footage into anime, painting, or film-like visuals. | ||
|
||
### Frame Interpolation | ||
Generate intermediate frames to make videos smoother or convert 30 FPS videos to 60 FPS. This improves motion flow and enables realistic slow-motion playback. | ||
|
||
### Video Super-Resolution | ||
Enhance low-resolution videos into high-definition outputs with preserved detail and sharpness. Ideal for restoring old footage or improving video quality. | ||
|
||
### Motion Transfer | ||
Transfer the motion from a source video to another subject while maintaining identity and environment. This enables realistic animation or gesture replication. | ||
|
||
### Video Editing & Synthesis | ||
Add, remove, or modify objects in videos while keeping lighting and motion consistent. Perfect for visual effects, object replacement, and content-aware editing. | ||
|
||
### Temporal Modification | ||
Change a video’s overall time or environmental conditions, such as day to night or summer to winter. These models preserve motion dynamics and lighting continuity. | ||
|
||
### Virtual Try-on | ||
Simulate clothing changes or outfit fitting in videos while keeping the person’s motion and identity intact. Useful for digital fashion and e-commerce applications. | ||
|
||
|
||
## Inference | ||
Below is an example demonstrating how to use [Lucy-Edit-Dev](https://huggingface.co/decart-ai/Lucy-Edit-Dev) to perform video costume editing, changing a character’s clothing while maintaining identity and motion consistency. Lucy-Edit-Dev is trained on paired video edits, captioned videos, and extended image–text datasets. | ||
|
||
```python | ||
|
||
import torch | ||
from PIL import Image | ||
|
||
from diffusers import AutoencoderKLWan, LucyEditPipeline | ||
from diffusers.utils import export_to_video, load_video | ||
|
||
|
||
url = "https://d2drjpuinn46lb.cloudfront.net/painter_original_edit.mp4" | ||
prompt = "Change the apron and blouse to a classic clown costume: satin polka-dot jumpsuit in bright primary colors, ruffled white collar, oversized pom-pom buttons, white gloves, oversized red shoes, red foam nose; soft window light from left, eye-level medium shot, natural folds and fabric highlights." | ||
negative_prompt = "" | ||
num_frames = 81 | ||
height = 480 | ||
width = 832 | ||
|
||
def convert_video(video: List[Image.Image]) -> List[Image.Image]: | ||
video = load_video(url)[:num_frames] | ||
video = [video[i].resize((width, height)) for i in range(num_frames)] | ||
return video | ||
|
||
video = load_video(url, convert_method=convert_video) | ||
|
||
model_id = "decart-ai/Lucy-Edit-Dev" | ||
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32) | ||
pipe = LucyEditPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16) | ||
pipe.to("cuda") | ||
|
||
output = pipe( | ||
prompt=prompt, | ||
video=video, | ||
negative_prompt=negative_prompt, | ||
height=480, | ||
width=832, | ||
num_frames=81, | ||
guidance_scale=5.0 | ||
).frames[0] | ||
|
||
export_to_video(output, "output.mp4", fps=24) | ||
|
||
``` | ||
|
||
For more inference examples, check out the model cards on Hugging Face, where you can try the provided example code. | ||
|
||
## Useful Resources | ||
You can read more about the datasets, model architectures, and open-source implementations in the following repositories: | ||
|
||
- [Lumen](https://github.com/Kunbyte-AI/Lumen) - Official implementation of Lumen for text-guided video editing. | ||
- [VIRES](https://github.com/suimuc/VIRES) - Implementation for sketch- and text-guided video instance repainting. | ||
- [ECCV2022-RIFE: Video Frame Interpolation](https://github.com/hzwer/ECCV2022-RIFE)- Real-time video frame interpolation via intermediate flow estimation. | ||
- [StableVSR: Enhancing Perceptual Quality in Video](https://github.com/claudiom4sir/StableVSR)- Super-resolution method to enhance perceptual video quality. | ||
|
||
|
||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import type { TaskDataCustom } from "../index.js"; | ||
|
||
const taskData: TaskDataCustom = { | ||
datasets: [ | ||
{ | ||
description: "Dataset with detailed annotations for training and benchmarking video instance editing.", | ||
id: "suimu/VIRESET", | ||
}, | ||
{ | ||
description: "Dataset to evaluate models on long video generation and understanding.", | ||
id: "zhangsh2001/LongV-EVAL", | ||
}, | ||
{ | ||
description: "Collection of 104 demo videos from the SeedVR/SeedVR2 series showcasing model outputs.", | ||
id: "Iceclear/SeedVR_VideoDemos", | ||
}, | ||
], | ||
demo: { | ||
inputs: [ | ||
{ | ||
filename: "input.gif", | ||
type: "img", | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
filename: "output.gif", | ||
type: "img", | ||
}, | ||
], | ||
}, | ||
metrics: [], | ||
models: [ | ||
{ | ||
description: | ||
"Model for editing outfits, character, and scenery in videos.", | ||
id: "decart-ai/Lucy-Edit-Dev", | ||
}, | ||
{ | ||
description: "Video upscaling model that enhances resolution while preserving quality.", | ||
id: "ByteDance-Seed/SeedVR2-7B", | ||
}, | ||
{ | ||
description: "Framework that uses 3D mesh proxies for precise, consistent video editing.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we try to add most used ones, let's exclude this |
||
id: "LeoLau/Shape-for-Motion", | ||
}, | ||
{ | ||
description: "A model to upscale videos at input, designed for seamless use with ComfyUI.", | ||
id: "numz/SeedVR2_comfyUI", | ||
}, | ||
{ | ||
description: "Model for relighting videos by manipulating illumination distributions.", | ||
id: "TeslaYang123/TC-Light", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one as well. would be nice to find more used ones |
||
}, | ||
], | ||
spaces: [ | ||
{ | ||
description: "Interactive demo space for Lucy-Edit-Dev video editing.", | ||
id: "decart-ai/lucy-edit-dev", | ||
}, | ||
{ | ||
description: "Demo space for SeedVR2-3B showcasing video upscaling and restoration.", | ||
id: "ByteDance-Seed/SeedVR2-3B", | ||
}, | ||
], | ||
summary: | ||
"Video-to-video models take one or more videos as input and generate new videos as output. They can enhance quality, interpolate frames, modify styles, or create new motion dynamics, enabling creative applications, video production, and research.", | ||
widgetModels: [], | ||
youtubeId: "", | ||
}; | ||
|
||
export default taskData; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove these lines below