Skip to content
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

python api code for text to video generation? #633

Open
SutirthaChakraborty opened this issue Aug 19, 2024 · 6 comments
Open

python api code for text to video generation? #633

SutirthaChakraborty opened this issue Aug 19, 2024 · 6 comments
Assignees

Comments

@SutirthaChakraborty
Copy link

How long videos can we generate? what would be the best model combinations ?

@SamitHuang
Copy link
Collaborator

SamitHuang commented Aug 28, 2024

Hi @SutirthaChakraborty with opensora_hpcai, we support generating 720P videos of 16 seconds (408 frames).

For model combination, do you mean combining text-to-image model with image-to-video model? If so, I would suggest using SD3 or Flux.1 (in PR) for T2I generation followed by DynamiCrafter for I2V generation for the best visual quality. If you prefer long videos, you may use opensora_hpcai to do I2V.

Thanks for your attention to our aigc kit.

@SutirthaChakraborty
Copy link
Author

Hi @SamitHuang Thanks for your detailed reply.
Is there any code reference for using SD3 + DynamiCrafter pre-trained weights and saving the mp4? Just like you provided for image generation in the readme file.

@SamitHuang
Copy link
Collaborator

SamitHuang commented Aug 28, 2024

Sure.

>>> import mindspore
>>> from mindone.diffusers import StableDiffusion3Pipeline

>>> pipe = StableDiffusion3Pipeline.from_pretrained(
...     "stabilityai/stable-diffusion-3-medium-diffusers",
...     mindspore_dtype=mindspore.float16,
... )
>>> prompt = "A cat holding a sign that says hello world"
>>> image = pipe(prompt)[0][0]
>>> image.save("sd3.png")

@SutirthaChakraborty
Copy link
Author

There is no direct way to run the dynamicrafter?

@SamitHuang
Copy link
Collaborator

There is no direct way to run the dynamicrafter?

Sorry that it can only run with script/inference.py currently. @HaoyangLee may consider wrapping the inference script into a class or function that is easier to integrate into a high-level pipeline.

1 similar comment
@SamitHuang
Copy link
Collaborator

There is no direct way to run the dynamicrafter?

Sorry that it can only run with script/inference.py currently. @HaoyangLee may consider wrapping the inference script into a class or function that is easier to integrate into a high-level pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants