-
Notifications
You must be signed in to change notification settings - Fork 179
Add gradio local inference demo #740
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
JiayiZhangA
wants to merge
8
commits into
hao-ai-lab:main
Choose a base branch
from
JiayiZhangA:zhang-ainsley
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
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b3a7ca3
Add gradio local inference demo
JiayiZhangA 9ce4794
Update gradio local demo
JiayiZhangA 199bb85
Update readme
JiayiZhangA 426f1fd
Update error handling for VSA
JiayiZhangA 7117a81
Update generate_video
JiayiZhangA f1ed7ef
pre-commit fix
JiayiZhangA 7b72aa3
update gradio_local_demo and video_generator
JiayiZhangA 3bb3c06
update gradio_local_demo and video_generator
JiayiZhangA 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
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,56 @@ | ||
# FastVideo Gradio Local Demo | ||
|
||
This is a Gradio-based web interface for generating videos using the FastVideo framework. The demo allows users to create videos from text prompts with various customization options. | ||
|
||
## Overview | ||
|
||
The demo uses the FastVideo framework to generate videos based on text prompts. It provides a simple web interface built with Gradio that allows users to: | ||
|
||
- Enter text prompts to generate videos | ||
- Customize video parameters (dimensions, number of frames, etc.) | ||
- Use negative prompts to guide the generation process | ||
- Set or randomize seeds for reproducibility | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
Run the demo with: | ||
|
||
```bash | ||
python examples/inference/gradio/local/gradio_local_demo.py | ||
``` | ||
|
||
This will start a web server at `http://0.0.0.0:7860` where you can access the interface. | ||
|
||
--- | ||
|
||
## Model Initialization | ||
|
||
This demo initializes a `VideoGenerator` with the minimum required arguments for inference. Users can seamlessly adjust inference options between generations, including prompts, resolution, video length, *without ever needing to reload the model*. | ||
|
||
## Video Generation | ||
|
||
The core functionality is in the `generate_video` function, which: | ||
1. Processes user inputs | ||
2. Uses the FastVideo VideoGenerator from earlier to run inference (`generator.generate_video()`) | ||
|
||
## Gradio Interface | ||
|
||
The interface is built with several components: | ||
- A text input for the prompt | ||
- A video display for the result | ||
- Inference options in a collapsible accordion: | ||
- Height and width sliders | ||
- Number of frames slider | ||
- Guidance scale slider | ||
- Negative prompt options | ||
- Seed controls | ||
|
||
### Inference Options | ||
|
||
- **Height/Width**: Control the resolution of the generated video | ||
- **Number of Frames**: Set how many frames to generate | ||
- **Guidance Scale**: Control how closely the generation follows the prompt | ||
- **Negative Prompt**: Specify what you don't want to see in the video | ||
- **Seed**: Control randomness for reproducible results |
Oops, something went wrong.
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.
rename to README.md