SkyReels-V2: Infinite-length Film Generative model¶
SkyReels-V2 by the SkyReels Team.
Recent advances in video generation have been driven by diffusion models and autoregressive frameworks, yet critical challenges persist in harmonizing prompt adherence, visual quality, motion dynamics, and duration: compromises in motion dynamics to enhance temporal visual quality, constrained video duration (5-10 seconds) to prioritize resolution, and inadequate shot-aware generation stemming from general-purpose MLLMs' inability to interpret cinematic grammar, such as shot composition, actor expressions, and camera motions. These intertwined limitations hinder realistic long-form synthesis and professional film-style generation. To address these limitations, we propose SkyReels-V2, an Infinite-length Film Generative Model, that synergizes Multi-modal Large Language Model (MLLM), Multi-stage Pretraining, Reinforcement Learning, and Diffusion Forcing Framework. Firstly, we design a comprehensive structural representation of video that combines the general descriptions by the Multi-modal LLM and the detailed shot language by sub-expert models. Aided with human annotation, we then train a unified Video Captioner, named SkyCaptioner-V1, to efficiently label the video data. Secondly, we establish progressive-resolution pretraining for the fundamental video generation, followed by a four-stage post-training enhancement: Initial concept-balanced Supervised Fine-Tuning (SFT) improves baseline quality; Motion-specific Reinforcement Learning (RL) training with human-annotated and synthetic distortion data addresses dynamic artifacts; Our diffusion forcing framework with non-decreasing noise schedules enables long-video synthesis in an efficient search space; Final high-quality SFT refines visual fidelity. All the code and models are available at this https URL.
You can find all the original SkyReels-V2 checkpoints under the Skywork organization.
The following SkyReels-V2 models are supported in Diffusers: - SkyReels-V2 DF 1.3B - 540P - SkyReels-V2 DF 14B - 540P - SkyReels-V2 DF 14B - 720P - SkyReels-V2 T2V 14B - 540P - SkyReels-V2 T2V 14B - 720P - SkyReels-V2 I2V 1.3B - 540P - SkyReels-V2 I2V 14B - 540P - SkyReels-V2 I2V 14B - 720P - SkyReels-V2 FLF2V 1.3B - 540P
Tip
Click on the SkyReels-V2 models in the right sidebar for more examples of video generation.
A Visual Demonstration¶
An example with these parameters:
base_num_frames=97, num_frames=97, num_inference_steps=30, ar_step=5, causal_block_size=5
vae_scale_factor_temporal -> 4
num_latent_frames: (97-1)//vae_scale_factor_temporal+1 = 25 frames -> 5 blocks of 5 frames each
base_num_latent_frames = (97-1)//vae_scale_factor_temporal+1 = 25 → blocks = 25//5 = 5 blocks
This 5 blocks means the maximum context length of the model is 25 frames in the latent space.
Asynchronous Processing Timeline:
┌─────────────────────────────────────────────────────────────────┐
│ Steps: 1 6 11 16 21 26 31 36 41 46 50 │
│ Block 1: [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] │
│ Block 2: [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] │
│ Block 3: [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] │
│ Block 4: [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] │
│ Block 5: [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] │
└─────────────────────────────────────────────────────────────────┘
For Long Videos (num_frames > base_num_frames):
base_num_frames acts as the "sliding window size" for processing long videos.
Example: 257-frame video with base_num_frames=97, overlap_history=17
┌──── Iteration 1 (frames 1-97) ────┐
│ Processing window: 97 frames │ → 5 blocks, async processing
│ Generates: frames 1-97 │
└───────────────────────────────────┘
┌────── Iteration 2 (frames 81-177) ──────┐
│ Processing window: 97 frames │
│ Overlap: 17 frames (81-97) from prev │ → 5 blocks, async processing
│ Generates: frames 98-177 │
└─────────────────────────────────────────┘
┌────── Iteration 3 (frames 161-257) ──────┐
│ Processing window: 97 frames │
│ Overlap: 17 frames (161-177) from prev │ → 5 blocks, async processing
│ Generates: frames 178-257 │
└──────────────────────────────────────────┘
Each iteration independently runs the asynchronous processing with its own 5 blocks.
base_num_frames controls:
1. Memory usage (larger window = more VRAM)
2. Model context length (must match training constraints)
3. Number of blocks per iteration (base_num_latent_frames // causal_block_size)
Each block takes 30 steps to complete denoising.
Block N starts at step: 1 + (N-1) x ar_step
Total steps: 30 + (5-1) x 5 = 50 steps
Synchronous mode (ar_step=0) would process all blocks/frames simultaneously:
┌──────────────────────────────────────────────┐
│ Steps: 1 ... 30 │
│ All blocks: [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] │
└──────────────────────────────────────────────┘
Total steps: 30 steps
An example on how the step matrix is constructed for asynchronous processing:
Given the parameters: (num_inference_steps=30, flow_shift=8, num_frames=97, ar_step=5, causal_block_size=5)
- num_latent_frames = (97 frames - 1) // (4 temporal downsampling) + 1 = 25
- step_template = [999, 995, 991, 986, 980, 975, 969, 963, 956, 948,
941, 932, 922, 912, 901, 888, 874, 859, 841, 822,
799, 773, 743, 708, 666, 615, 551, 470, 363, 216]
The algorithm creates a 50x25 step_matrix where:
- Row 1: [999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999]
- Row 2: [995, 995, 995, 995, 995, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999]
- Row 3: [991, 991, 991, 991, 991, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999]
- ...
- Row 7: [969, 969, 969, 969, 969, 995, 995, 995, 995, 995, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999]
- ...
- Row 21: [799, 799, 799, 799, 799, 888, 888, 888, 888, 888, 941, 941, 941, 941, 941, 975, 975, 975, 975, 975, 999, 999, 999, 999, 999]
- ...
- Row 35: [ 0, 0, 0, 0, 0, 216, 216, 216, 216, 216, 666, 666, 666, 666, 666, 822, 822, 822, 822, 822, 901, 901, 901, 901, 901]
- ...
- Row 42: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 551, 551, 551, 551, 551, 773, 773, 773, 773, 773]
- ...
- Row 50: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 216, 216, 216, 216]
Detailed Row 6 Analysis:
- step_matrix[5]: [ 975, 975, 975, 975, 975, 999, 999, 999, 999, 999, 999, ..., 999]
- step_index[5]: [ 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 0, ..., 0]
- step_update_mask[5]: [True,True,True,True,True,True,True,True,True,True,False, ...,False]
- valid_interval[5]: (0, 25)
Key Pattern: Block i lags behind Block i-1 by exactly ar_step=5 timesteps, creating the
staggered "diffusion forcing" effect where later blocks condition on cleaner earlier blocks.
Text-to-Video Generation¶
The example below demonstrates how to generate a video from text.
Refer to the Reduce memory usage guide for more details about the various memory saving techniques.
From the original repo:
You can use --ar_step 5 to enable asynchronous inference. When asynchronous inference, --causal_block_size 5 is recommended while it is not supposed to be set for synchronous generation... Asynchronous inference will take more steps to diffuse the whole sequence which means it will be SLOWER than synchronous mode. In our experiments, asynchronous inference may improve the instruction following and visual consistent performance.
# pip install ftfy
import mindspore as ms
from mindone.diffusers import AutoModel, SkyReelsV2DiffusionForcingPipeline, UniPCMultistepScheduler
from mindone.diffusers.utils import export_to_video
vae = AutoModel.from_pretrained("Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers", subfolder="vae", mindspore_dtype=ms.float32)
transformer = AutoModel.from_pretrained("Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers", subfolder="transformer", mindspore_dtype=ms.bfloat16)
pipeline = SkyReelsV2DiffusionForcingPipeline.from_pretrained(
"Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers",
vae=vae,
transformer=transformer,
mindspore_dtype=ms.bfloat16
)
flow_shift = 8.0 # 8.0 for T2V, 5.0 for I2V
pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.config, flow_shift=flow_shift)
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."
output = pipeline(
prompt=prompt,
num_inference_steps=30,
height=544, # 720 for 720P
width=960, # 1280 for 720P
num_frames=97,
base_num_frames=97, # 121 for 720P
ar_step=5, # Controls asynchronous inference (0 for synchronous mode)
causal_block_size=5, # Number of frames in each block for asynchronous processing
overlap_history=None, # Number of frames to overlap for smooth transitions in long videos; 17 for long video generations
addnoise_condition=20, # Improves consistency in long video generation
)[0][0]
export_to_video(output, "T2V.mp4", fps=24, quality=8)
First-Last-Frame-to-Video Generation¶
The example below demonstrates how to use the image-to-video pipeline to generate a video using a text description, a starting frame, and an ending frame.
import math
import numpy as np
import mindspore as ms
from mindone.diffusers import AutoencoderKLWan, SkyReelsV2DiffusionForcingImageToVideoPipeline, UniPCMultistepScheduler
from mindone.diffusers.utils import export_to_video, load_image
model_id = "Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers"
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", mindspore_dtype=ms.float32)
pipeline = SkyReelsV2DiffusionForcingImageToVideoPipeline.from_pretrained(
model_id, vae=vae, mindspore_dtype=ms.bfloat16
)
flow_shift = 5.0 # 8.0 for T2V, 5.0 for I2V
pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.config, flow_shift=flow_shift)
first_frame = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_first_frame.png")
last_frame = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_last_frame.png")
def aspect_ratio_resize(image, pipeline, max_area=720 * 1280):
aspect_ratio = image.height / image.width
mod_value = pipeline.vae_scale_factor_spatial * pipeline.transformer.config.patch_size[1]
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
image = image.resize((width, height))
return image, height, width
def center_crop_pil(img, output_size):
if isinstance(output_size, int):
output_size = (output_size, output_size)
elif isinstance(output_size, tuple) and len(output_size) == 1:
output_size = (output_size[0], output_size[0])
width, height = img.size
target_height, target_width = output_size
left = (width - target_width) / 2
top = (height - target_height) / 2
right = (width + target_width) / 2
bottom = (height + target_height) / 2
left = math.floor(left)
top = math.floor(top)
right = math.floor(right)
bottom = math.floor(bottom)
return img.crop((left, top, right, bottom))
def center_crop_resize(image, height, width):
# Calculate resize ratio to match first frame dimensions
resize_ratio = max(width / image.width, height / image.height)
# Resize the image
width = round(image.width * resize_ratio)
height = round(image.height * resize_ratio)
size = [width, height]
image = center_crop_pil(image, size)
return image, height, width
first_frame, height, width = aspect_ratio_resize(first_frame, pipeline)
if last_frame.size != first_frame.size:
last_frame, _, _ = center_crop_resize(last_frame, height, width)
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."
output = pipeline(
image=first_frame, last_image=last_frame, prompt=prompt, height=height, width=width, guidance_scale=5.0
)[0][0]
export_to_video(output, "output.mp4", fps=24, quality=8)
Video-to-Video Generation¶
SkyReelsV2DiffusionForcingVideoToVideoPipeline
extends a given video.
import numpy as np
import mindspore as ms
from mindone.diffusers import AutoencoderKLWan, SkyReelsV2DiffusionForcingVideoToVideoPipeline, UniPCMultistepScheduler
from mindone.diffusers.utils import export_to_video, load_video
model_id = "Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers"
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", mindspore_dtype=ms.float32)
pipeline = SkyReelsV2DiffusionForcingVideoToVideoPipeline.from_pretrained(
model_id, vae=vae, mindspore_dtype=ms.bfloat16
)
flow_shift = 5.0 # 8.0 for T2V, 5.0 for I2V
pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.config, flow_shift=flow_shift)
video = load_video("input_video.mp4")
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."
output = pipeline(
video=video, prompt=prompt, height=544, width=960, guidance_scale=5.0,
num_inference_steps=30, num_frames=257, base_num_frames=97, overlap_history=17#, ar_step=5, causal_block_size=5,
)[0][0]
export_to_video(output, "output.mp4", fps=24, quality=8)
# Total frames will be the number of frames of given video + 257
mindone.diffusers.SkyReelsV2DiffusionForcingPipeline
¶
Bases: DiffusionPipeline
, SkyReelsV2LoraLoaderMixin
Pipeline for Text-to-Video (t2v) generation using SkyReels-V2 with diffusion forcing.
This model inherits from [DiffusionPipeline
]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a specific device, etc.).
PARAMETER | DESCRIPTION |
---|---|
tokenizer
|
Tokenizer from T5, specifically the google/umt5-xxl variant.
TYPE:
|
text_encoder
|
T5, specifically the google/umt5-xxl variant.
TYPE:
|
transformer
|
Conditional Transformer to denoise the encoded image latents.
TYPE:
|
scheduler
|
A scheduler to be used in combination with
TYPE:
|
vae
|
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingPipeline.__call__(prompt, negative_prompt=None, height=544, width=960, num_frames=97, num_inference_steps=50, guidance_scale=6.0, num_videos_per_prompt=1, generator=None, latents=None, prompt_embeds=None, negative_prompt_embeds=None, output_type='np', return_dict=False, attention_kwargs=None, callback_on_step_end=None, callback_on_step_end_tensor_inputs=['latents'], max_sequence_length=512, overlap_history=None, addnoise_condition=0, base_num_frames=97, ar_step=0, causal_block_size=None, fps=24)
¶
The call function to the pipeline for generation.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
The prompt or prompts to guide the image generation. If not defined, one has to pass
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
height
|
The height of the generated video.
TYPE:
|
width
|
The width of the generated video.
TYPE:
|
num_frames
|
The number of frames in the generated video.
TYPE:
|
num_inference_steps
|
The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
TYPE:
|
guidance_scale
|
Guidance scale as defined in Classifier-Free Diffusion Guidance.
TYPE:
|
num_videos_per_prompt
|
The number of images to generate per prompt.
TYPE:
|
generator
|
A
TYPE:
|
latents
|
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
negative_prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
output_type
|
The output format of the generated image. Choose between
TYPE:
|
return_dict
|
Whether or not to return a [
TYPE:
|
attention_kwargs
|
A kwargs dictionary that if specified is passed along to the
TYPE:
|
callback_on_step_end
|
A function or a subclass of
TYPE:
|
callback_on_step_end_tensor_inputs
|
The list of tensor inputs for the
TYPE:
|
max_sequence_length
|
The maximum sequence length of the prompt.
TYPE:
|
overlap_history
|
Number of frames to overlap for smooth transitions in long videos. If
TYPE:
|
addnoise_condition
|
This is used to help smooth the long video generation by adding some noise to the clean condition. Too large noise can cause the inconsistency as well. 20 is a recommended value, and you may try larger ones, but it is recommended to not exceed 50.
TYPE:
|
base_num_frames
|
97 or 121 | Base frame count (97 for 540P, 121 for 720P)
TYPE:
|
ar_step
|
Controls asynchronous inference (0 for synchronous mode) You can set
TYPE:
|
causal_block_size
|
The number of frames in each block/chunk. Recommended when using asynchronous inference (when ar_step > 0)
TYPE:
|
fps
|
Frame rate of the generated video
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
[ |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingPipeline.encode_prompt(prompt, negative_prompt=None, do_classifier_free_guidance=True, num_videos_per_prompt=1, prompt_embeds=None, negative_prompt_embeds=None, max_sequence_length=226, dtype=None)
¶
Encodes the prompt into text encoder hidden states.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
prompt to be encoded
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
do_classifier_free_guidance
|
Whether to use classifier free guidance or not.
TYPE:
|
num_videos_per_prompt
|
Number of videos that should be generated per prompt.
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not
provided, text embeddings will be generated from
TYPE:
|
negative_prompt_embeds
|
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, e.g. prompt
weighting. If not provided, negative_prompt_embeds will be generated from
TYPE:
|
dtype
|
(
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingPipeline.generate_timestep_matrix(num_latent_frames, step_template, base_num_latent_frames, ar_step=5, num_pre_ready=0, causal_block_size=1, shrink_interval_with_mask=False)
¶
This function implements the core diffusion forcing algorithm that creates a coordinated denoising schedule across temporal frames. It supports both synchronous and asynchronous generation modes:
Synchronous Mode (ar_step=0, causal_block_size=1): - All frames are denoised simultaneously at each timestep - Each frame follows the same denoising trajectory: [1000, 800, 600, ..., 0] - Simpler but may have less temporal consistency for long videos
Asynchronous Mode (ar_step>0, causal_block_size>1): - Frames are grouped into causal blocks and processed block/chunk-wise - Each block is denoised in a staggered pattern creating a "denoising wave" - Earlier blocks are more denoised, later blocks lag behind by ar_step timesteps - Creates stronger temporal dependencies and better consistency
PARAMETER | DESCRIPTION |
---|---|
num_latent_frames
|
Total number of latent frames to generate
TYPE:
|
step_template
|
Base timestep schedule (e.g., [1000, 800, 600, ..., 0])
TYPE:
|
base_num_latent_frames
|
Maximum frames the model can process in one forward pass
TYPE:
|
ar_step
|
Autoregressive step size for temporal lag. 0 = synchronous, >0 = asynchronous. Defaults to 5.
TYPE:
|
num_pre_ready
|
TYPE:
|
causal_block_size
|
Number of frames processed as a causal block. Defaults to 1.
TYPE:
|
shrink_interval_with_mask
|
Whether to optimize processing intervals. Defaults to False.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Tensor, Tensor, Tensor, list[tuple]]
|
tuple containing: - step_matrix (ms.Tensor): Matrix of timesteps for each frame at each iteration Shape: [num_iterations, num_latent_frames] - step_index (ms.Tensor): Index matrix for timestep lookup Shape: [num_iterations, num_latent_frames] - step_update_mask (ms.Tensor): Boolean mask indicating which frames to update Shape: [num_iterations, num_latent_frames] - valid_interval (list[tuple]): List of (start, end) intervals for each iteration |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If ar_step is too small for the given configuration |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingImageToVideoPipeline
¶
Bases: DiffusionPipeline
, SkyReelsV2LoraLoaderMixin
Pipeline for Image-to-Video (i2v) generation using SkyReels-V2 with diffusion forcing.
This model inherits from [DiffusionPipeline
]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a specific device, etc.).
PARAMETER | DESCRIPTION |
---|---|
tokenizer
|
Tokenizer from T5, specifically the google/umt5-xxl variant.
TYPE:
|
text_encoder
|
T5, specifically the google/umt5-xxl variant.
TYPE:
|
transformer
|
Conditional Transformer to denoise the encoded image latents.
TYPE:
|
scheduler
|
A scheduler to be used in combination with
TYPE:
|
vae
|
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingImageToVideoPipeline.__call__(image, prompt=None, negative_prompt=None, height=544, width=960, num_frames=97, num_inference_steps=50, guidance_scale=5.0, num_videos_per_prompt=1, generator=None, latents=None, prompt_embeds=None, negative_prompt_embeds=None, image_embeds=None, last_image=None, output_type='np', return_dict=False, attention_kwargs=None, callback_on_step_end=None, callback_on_step_end_tensor_inputs=['latents'], max_sequence_length=512, overlap_history=None, addnoise_condition=0, base_num_frames=97, ar_step=0, causal_block_size=None, fps=24)
¶
The call function to the pipeline for generation.
PARAMETER | DESCRIPTION |
---|---|
image
|
The input image to condition the generation on. Must be an image, a list of images or a
TYPE:
|
prompt
|
The prompt or prompts to guide the image generation. If not defined, one has to pass
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
height
|
The height of the generated video.
TYPE:
|
width
|
The width of the generated video.
TYPE:
|
num_frames
|
The number of frames in the generated video.
TYPE:
|
num_inference_steps
|
The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
TYPE:
|
guidance_scale
|
Guidance scale as defined in Classifier-Free Diffusion Guidance.
TYPE:
|
num_videos_per_prompt
|
The number of images to generate per prompt.
TYPE:
|
generator
|
A
TYPE:
|
latents
|
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
negative_prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
image_embeds
|
Pre-generated image embeddings. Can be used to easily tweak image inputs (weighting). If not provided,
image embeddings are generated from the
TYPE:
|
last_image
|
Pre-generated image embeddings. Can be used to easily tweak image inputs (weighting). If not provided,
image embeddings are generated from the
TYPE:
|
output_type
|
The output format of the generated image. Choose between
TYPE:
|
return_dict
|
Whether or not to return a [
TYPE:
|
attention_kwargs
|
A kwargs dictionary that if specified is passed along to the
TYPE:
|
callback_on_step_end
|
A function or a subclass of
TYPE:
|
callback_on_step_end_tensor_inputs
|
The list of tensor inputs for the
TYPE:
|
max_sequence_length
|
The maximum sequence length of the prompt.
TYPE:
|
overlap_history
|
Number of frames to overlap for smooth transitions in long videos. If
TYPE:
|
addnoise_condition
|
This is used to help smooth the long video generation by adding some noise to the clean condition. Too large noise can cause the inconsistency as well. 20 is a recommended value, and you may try larger ones, but it is recommended to not exceed 50.
TYPE:
|
base_num_frames
|
97 or 121 | Base frame count (97 for 540P, 121 for 720P)
TYPE:
|
ar_step
|
Controls asynchronous inference (0 for synchronous mode) You can set
TYPE:
|
causal_block_size
|
The number of frames in each block/chunk. Recommended when using asynchronous inference (when ar_step > 0)
TYPE:
|
fps
|
Frame rate of the generated video
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
[ |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingImageToVideoPipeline.encode_prompt(prompt, negative_prompt=None, do_classifier_free_guidance=True, num_videos_per_prompt=1, prompt_embeds=None, negative_prompt_embeds=None, max_sequence_length=226, dtype=None)
¶
Encodes the prompt into text encoder hidden states.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
prompt to be encoded
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
do_classifier_free_guidance
|
Whether to use classifier free guidance or not.
TYPE:
|
num_videos_per_prompt
|
Number of videos that should be generated per prompt.
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not
provided, text embeddings will be generated from
TYPE:
|
negative_prompt_embeds
|
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, e.g. prompt
weighting. If not provided, negative_prompt_embeds will be generated from
TYPE:
|
dtype
|
(
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingImageToVideoPipeline.generate_timestep_matrix(num_latent_frames, step_template, base_num_latent_frames, ar_step=5, num_pre_ready=0, causal_block_size=1, shrink_interval_with_mask=False)
¶
This function implements the core diffusion forcing algorithm that creates a coordinated denoising schedule across temporal frames. It supports both synchronous and asynchronous generation modes:
Synchronous Mode (ar_step=0, causal_block_size=1): - All frames are denoised simultaneously at each timestep - Each frame follows the same denoising trajectory: [1000, 800, 600, ..., 0] - Simpler but may have less temporal consistency for long videos
Asynchronous Mode (ar_step>0, causal_block_size>1): - Frames are grouped into causal blocks and processed block/chunk-wise - Each block is denoised in a staggered pattern creating a "denoising wave" - Earlier blocks are more denoised, later blocks lag behind by ar_step timesteps - Creates stronger temporal dependencies and better consistency
PARAMETER | DESCRIPTION |
---|---|
num_latent_frames
|
Total number of latent frames to generate
TYPE:
|
step_template
|
Base timestep schedule (e.g., [1000, 800, 600, ..., 0])
TYPE:
|
base_num_latent_frames
|
Maximum frames the model can process in one forward pass
TYPE:
|
ar_step
|
Autoregressive step size for temporal lag. 0 = synchronous, >0 = asynchronous. Defaults to 5.
TYPE:
|
num_pre_ready
|
TYPE:
|
causal_block_size
|
Number of frames processed as a causal block. Defaults to 1.
TYPE:
|
shrink_interval_with_mask
|
Whether to optimize processing intervals. Defaults to False.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Tensor, Tensor, Tensor, list[tuple]]
|
tuple containing: - step_matrix (ms.Tensor): Matrix of timesteps for each frame at each iteration Shape: [num_iterations, num_latent_frames] - step_index (ms.Tensor): Index matrix for timestep lookup Shape: [num_iterations, num_latent_frames] - step_update_mask (ms.Tensor): Boolean mask indicating which frames to update Shape: [num_iterations, num_latent_frames] - valid_interval (list[tuple]): List of (start, end) intervals for each iteration |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If ar_step is too small for the given configuration |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_i2v.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingVideoToVideoPipeline
¶
Bases: DiffusionPipeline
, SkyReelsV2LoraLoaderMixin
Pipeline for Video-to-Video (v2v) generation using SkyReels-V2 with diffusion forcing.
This model inherits from [DiffusionPipeline
]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a specific device, etc.).
PARAMETER | DESCRIPTION |
---|---|
tokenizer
|
Tokenizer from T5, specifically the google/umt5-xxl variant.
TYPE:
|
text_encoder
|
T5, specifically the google/umt5-xxl variant.
TYPE:
|
transformer
|
Conditional Transformer to denoise the encoded image latents.
TYPE:
|
scheduler
|
A scheduler to be used in combination with
TYPE:
|
vae
|
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingVideoToVideoPipeline.__call__(video, prompt=None, negative_prompt=None, height=544, width=960, num_frames=120, num_inference_steps=50, guidance_scale=6.0, num_videos_per_prompt=1, generator=None, latents=None, prompt_embeds=None, negative_prompt_embeds=None, output_type='np', return_dict=False, attention_kwargs=None, callback_on_step_end=None, callback_on_step_end_tensor_inputs=['latents'], max_sequence_length=512, overlap_history=None, addnoise_condition=0, base_num_frames=97, ar_step=0, causal_block_size=None, fps=24)
¶
The call function to the pipeline for generation.
PARAMETER | DESCRIPTION |
---|---|
video
|
The video to guide the video generation.
TYPE:
|
prompt
|
The prompt or prompts to guide the video generation. If not defined, one has to pass
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the video generation. If not defined, one has to pass
TYPE:
|
height
|
The height of the generated video.
TYPE:
|
width
|
The width of the generated video.
TYPE:
|
num_frames
|
The number of frames in the generated video.
TYPE:
|
num_inference_steps
|
The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
TYPE:
|
guidance_scale
|
Guidance scale as defined in Classifier-Free Diffusion Guidance.
TYPE:
|
num_videos_per_prompt
|
The number of images to generate per prompt.
TYPE:
|
generator
|
A
TYPE:
|
latents
|
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
negative_prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
output_type
|
The output format of the generated image. Choose between
TYPE:
|
return_dict
|
Whether or not to return a [
TYPE:
|
attention_kwargs
|
A kwargs dictionary that if specified is passed along to the
TYPE:
|
callback_on_step_end
|
A function or a subclass of
TYPE:
|
callback_on_step_end_tensor_inputs
|
The list of tensor inputs for the
TYPE:
|
max_sequence_length
|
The maximum sequence length of the prompt.
TYPE:
|
overlap_history
|
Number of frames to overlap for smooth transitions in long videos. If
TYPE:
|
addnoise_condition
|
This is used to help smooth the long video generation by adding some noise to the clean condition. Too large noise can cause the inconsistency as well. 20 is a recommended value, and you may try larger ones, but it is recommended to not exceed 50.
TYPE:
|
base_num_frames
|
97 or 121 | Base frame count (97 for 540P, 121 for 720P)
TYPE:
|
ar_step
|
Controls asynchronous inference (0 for synchronous mode) You can set
TYPE:
|
causal_block_size
|
The number of frames in each block/chunk. Recommended when using asynchronous inference (when ar_step > 0)
TYPE:
|
fps
|
Frame rate of the generated video
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
[ |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingVideoToVideoPipeline.encode_prompt(prompt, negative_prompt=None, do_classifier_free_guidance=True, num_videos_per_prompt=1, prompt_embeds=None, negative_prompt_embeds=None, max_sequence_length=226, dtype=None)
¶
Encodes the prompt into text encoder hidden states.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
prompt to be encoded
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
do_classifier_free_guidance
|
Whether to use classifier free guidance or not.
TYPE:
|
num_videos_per_prompt
|
Number of videos that should be generated per prompt.
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not
provided, text embeddings will be generated from
TYPE:
|
negative_prompt_embeds
|
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, e.g. prompt
weighting. If not provided, negative_prompt_embeds will be generated from
TYPE:
|
dtype
|
(
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
|
mindone.diffusers.SkyReelsV2DiffusionForcingVideoToVideoPipeline.generate_timestep_matrix(num_latent_frames, step_template, base_num_latent_frames, ar_step=5, num_pre_ready=0, causal_block_size=1, shrink_interval_with_mask=False)
¶
This function implements the core diffusion forcing algorithm that creates a coordinated denoising schedule across temporal frames. It supports both synchronous and asynchronous generation modes:
Synchronous Mode (ar_step=0, causal_block_size=1): - All frames are denoised simultaneously at each timestep - Each frame follows the same denoising trajectory: [1000, 800, 600, ..., 0] - Simpler but may have less temporal consistency for long videos
Asynchronous Mode (ar_step>0, causal_block_size>1): - Frames are grouped into causal blocks and processed block/chunk-wise - Each block is denoised in a staggered pattern creating a "denoising wave" - Earlier blocks are more denoised, later blocks lag behind by ar_step timesteps - Creates stronger temporal dependencies and better consistency
PARAMETER | DESCRIPTION |
---|---|
num_latent_frames
|
Total number of latent frames to generate
TYPE:
|
step_template
|
Base timestep schedule (e.g., [1000, 800, 600, ..., 0])
TYPE:
|
base_num_latent_frames
|
Maximum frames the model can process in one forward pass
TYPE:
|
ar_step
|
Autoregressive step size for temporal lag. 0 = synchronous, >0 = asynchronous. Defaults to 5.
TYPE:
|
num_pre_ready
|
TYPE:
|
causal_block_size
|
Number of frames processed as a causal block. Defaults to 1.
TYPE:
|
shrink_interval_with_mask
|
Whether to optimize processing intervals. Defaults to False.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Tensor, Tensor, Tensor, list[tuple]]
|
tuple containing: - step_matrix (ms.Tensor): Matrix of timesteps for each frame at each iteration Shape: [num_iterations, num_latent_frames] - step_index (ms.Tensor): Index matrix for timestep lookup Shape: [num_iterations, num_latent_frames] - step_update_mask (ms.Tensor): Boolean mask indicating which frames to update Shape: [num_iterations, num_latent_frames] - valid_interval (list[tuple]): List of (start, end) intervals for each iteration |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If ar_step is too small for the given configuration |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_diffusion_forcing_v2v.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 |
|
mindone.diffusers.SkyReelsV2Pipeline
¶
Bases: DiffusionPipeline
, SkyReelsV2LoraLoaderMixin
Pipeline for Text-to-Video (t2v) generation using SkyReels-V2.
This model inherits from [DiffusionPipeline
]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).
PARAMETER | DESCRIPTION |
---|---|
tokenizer
|
Tokenizer from T5, specifically the google/umt5-xxl variant.
TYPE:
|
text_encoder
|
T5, specifically the google/umt5-xxl variant.
TYPE:
|
transformer
|
Conditional Transformer to denoise the input latents.
TYPE:
|
scheduler
|
A scheduler to be used in combination with
TYPE:
|
vae
|
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
|
mindone.diffusers.SkyReelsV2Pipeline.__call__(prompt=None, negative_prompt=None, height=544, width=960, num_frames=97, num_inference_steps=50, guidance_scale=6.0, num_videos_per_prompt=1, generator=None, latents=None, prompt_embeds=None, negative_prompt_embeds=None, output_type='np', return_dict=False, attention_kwargs=None, callback_on_step_end=None, callback_on_step_end_tensor_inputs=['latents'], max_sequence_length=512)
¶
The call function to the pipeline for generation.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
The prompt or prompts to guide the image generation. If not defined, one has to pass
TYPE:
|
height
|
The height in pixels of the generated image.
TYPE:
|
width
|
The width in pixels of the generated image.
TYPE:
|
num_frames
|
The number of frames in the generated video.
TYPE:
|
num_inference_steps
|
The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
TYPE:
|
guidance_scale
|
Guidance scale as defined in Classifier-Free Diffusion Guidance.
TYPE:
|
num_videos_per_prompt
|
The number of images to generate per prompt.
TYPE:
|
generator
|
A
TYPE:
|
latents
|
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
output_type
|
The output format of the generated image. Choose between
TYPE:
|
return_dict
|
Whether or not to return a [
TYPE:
|
attention_kwargs
|
A kwargs dictionary that if specified is passed along to the
TYPE:
|
callback_on_step_end
|
A function or a subclass of
TYPE:
|
callback_on_step_end_tensor_inputs
|
The list of tensor inputs for the
TYPE:
|
max_sequence_length
|
The maximum sequence length for the text encoder.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
[ |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
|
mindone.diffusers.SkyReelsV2Pipeline.encode_prompt(prompt, negative_prompt=None, do_classifier_free_guidance=True, num_videos_per_prompt=1, prompt_embeds=None, negative_prompt_embeds=None, max_sequence_length=226, dtype=None)
¶
Encodes the prompt into text encoder hidden states.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
prompt to be encoded
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
do_classifier_free_guidance
|
Whether to use classifier free guidance or not.
TYPE:
|
num_videos_per_prompt
|
Number of videos that should be generated per prompt.
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not
provided, text embeddings will be generated from
TYPE:
|
negative_prompt_embeds
|
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, e.g. prompt
weighting. If not provided, negative_prompt_embeds will be generated from
TYPE:
|
dtype
|
(
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
|
mindone.diffusers.SkyReelsV2ImageToVideoPipeline
¶
Bases: DiffusionPipeline
, SkyReelsV2LoraLoaderMixin
Pipeline for Image-to-Video (i2v) generation using SkyReels-V2.
This model inherits from [DiffusionPipeline
]. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).
PARAMETER | DESCRIPTION |
---|---|
tokenizer
|
Tokenizer from T5, specifically the google/umt5-xxl variant.
TYPE:
|
text_encoder
|
T5, specifically the google/umt5-xxl variant.
TYPE:
|
image_encoder
|
CLIP, specifically the clip-vit-huge-patch14 variant.
TYPE:
|
transformer
|
Conditional Transformer to denoise the input latents.
TYPE:
|
scheduler
|
A scheduler to be used in combination with
TYPE:
|
vae
|
Variational Auto-Encoder (VAE) Model to encode and decode videos to and from latent representations.
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
|
mindone.diffusers.SkyReelsV2ImageToVideoPipeline.__call__(image, prompt=None, negative_prompt=None, height=544, width=960, num_frames=97, num_inference_steps=50, guidance_scale=5.0, num_videos_per_prompt=1, generator=None, latents=None, prompt_embeds=None, negative_prompt_embeds=None, image_embeds=None, last_image=None, output_type='np', return_dict=False, attention_kwargs=None, callback_on_step_end=None, callback_on_step_end_tensor_inputs=['latents'], max_sequence_length=512)
¶
The call function to the pipeline for generation.
PARAMETER | DESCRIPTION |
---|---|
image
|
The input image to condition the generation on. Must be an image, a list of images or a
TYPE:
|
prompt
|
The prompt or prompts to guide the image generation. If not defined, one has to pass
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
height
|
The height of the generated video.
TYPE:
|
width
|
The width of the generated video.
TYPE:
|
num_frames
|
The number of frames in the generated video.
TYPE:
|
num_inference_steps
|
The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
TYPE:
|
guidance_scale
|
Guidance scale as defined in Classifier-Free Diffusion Guidance.
TYPE:
|
num_videos_per_prompt
|
The number of images to generate per prompt.
TYPE:
|
generator
|
A
TYPE:
|
latents
|
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
negative_prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the
TYPE:
|
image_embeds
|
Pre-generated image embeddings. Can be used to easily tweak image inputs (weighting). If not provided,
image embeddings are generated from the
TYPE:
|
output_type
|
The output format of the generated image. Choose between
TYPE:
|
return_dict
|
Whether or not to return a [
TYPE:
|
attention_kwargs
|
A kwargs dictionary that if specified is passed along to the
TYPE:
|
callback_on_step_end
|
A function or a subclass of
TYPE:
|
callback_on_step_end_tensor_inputs
|
The list of tensor inputs for the
TYPE:
|
max_sequence_length
|
The maximum sequence length of the prompt.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
[ |
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
|
mindone.diffusers.SkyReelsV2ImageToVideoPipeline.encode_prompt(prompt, negative_prompt=None, do_classifier_free_guidance=True, num_videos_per_prompt=1, prompt_embeds=None, negative_prompt_embeds=None, max_sequence_length=226, dtype=None)
¶
Encodes the prompt into text encoder hidden states.
PARAMETER | DESCRIPTION |
---|---|
prompt
|
prompt to be encoded
TYPE:
|
negative_prompt
|
The prompt or prompts not to guide the image generation. If not defined, one has to pass
TYPE:
|
do_classifier_free_guidance
|
Whether to use classifier free guidance or not.
TYPE:
|
num_videos_per_prompt
|
Number of videos that should be generated per prompt.
TYPE:
|
prompt_embeds
|
Pre-generated text embeddings. Can be used to easily tweak text inputs, e.g. prompt weighting. If not
provided, text embeddings will be generated from
TYPE:
|
negative_prompt_embeds
|
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, e.g. prompt
weighting. If not provided, negative_prompt_embeds will be generated from
TYPE:
|
dtype
|
(
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2_i2v.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
mindone.diffusers.pipelines.skyreels_v2.pipeline_output.SkyReelsV2PipelineOutput
dataclass
¶
Bases: BaseOutput
Output class for SkyReelsV2 pipelines.
PARAMETER | DESCRIPTION |
---|---|
frames
|
List of video outputs - It can be a nested list of length
TYPE:
|
Source code in mindone/diffusers/pipelines/skyreels_v2/pipeline_output.py
11 12 13 14 15 16 17 18 19 20 21 22 23 |
|