You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prompt ="A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window."
237
+
238
+
output = pipeline(
239
+
prompt=prompt,
240
+
num_inference_steps=30,
241
+
height=544, # 720 for 720P
242
+
width=960, # 1280 for 720P
243
+
num_frames=97,
244
+
base_num_frames=97, # 121 for 720P
245
+
ar_step=5, # Controls asynchronous inference (0 for synchronous mode)
246
+
causal_block_size=5, # Number of frames in each block for asynchronous processing
247
+
overlap_history=None, # Number of frames to overlap for smooth transitions in long videos; 17 for long video generations
248
+
addnoise_condition=20, # Improves consistency in long video generation
prompt ="CG animation style, a small blue bird takes off from the ground, flapping its wings. The bird's feathers are delicate, with a unique pattern on its chest. The background shows a blue sky with white clouds under bright sunshine. The camera follows the bird upward, capturing its flight and the vastness of the sky from a close-up, low-angle perspective."
> - If you want to run the **image-to-video (I2V)** task, add `--image ${image_path}` to your command and it is also better to use **text-to-video (T2V)**-like prompt which includes some descriptions of the first-frame image.
221
307
> - For long video generation, you can just switch the `--num_frames`, e.g., `--num_frames 257` for 10s video, `--num_frames 377` for 15s video, `--num_frames 737` for 30s video, `--num_frames 1457` for 60s video. The number is not strictly aligned with the logical frame number for specified time duration, but it is aligned with some training parameters, which means it may perform better. When you use asynchronous inference with causal_block_size > 1, the `--num_frames` should be carefully set.
> - When controlling the start and end frames, you need to pass the `--image ${image}` parameter to control the generation of the start frame and the `--end_image ${end_image}` parameter to control the generation of the end frame.
271
357
358
+
Video extension with `diffusers`:
359
+
```py
360
+
import numpy as np
361
+
import torch
362
+
import torchvision.transforms.functional asTF
363
+
from diffusers import AutoencoderKLWan, SkyReelsV2DiffusionForcingVideoToVideoPipeline, UniPCMultistepScheduler
364
+
from diffusers.utils import export_to_video, load_video
prompt ="CG animation style, a small blue bird takes off from the ground, flapping its wings. The bird's feathers are delicate, with a unique pattern on its chest. The background shows a blue sky with white clouds under bright sunshine. The camera follows the bird upward, capturing its flight and the vastness of the sky from a close-up, low-angle perspective."
# Total frames will be the number of frames of given video + 257
385
+
```
386
+
272
387
-**Text To Video & Image To Video**
273
388
274
389
```shell
@@ -291,6 +406,91 @@ python3 generate_video.py \
291
406
> - When using an **image-to-video (I2V)** model, you must provide an input image using the `--image ${image_path}` parameter. The `--guidance_scale 5.0` and `--shift 3.0` is recommended for I2V model.
292
407
> - Generating a 540P video using the 1.3B model requires approximately 14.7GB peak VRAM, while the same resolution video using the 14B model demands around 43.4GB peak VRAM.
prompt ="A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window."
prompt ="A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window."
0 commit comments