Instructions to use kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers", dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
Load with ModularPipeline: add modular_model_index.json
Browse files- README.md +20 -12
- model_index.json +0 -32
- modular_model_index.json +103 -0
README.md
CHANGED
|
@@ -38,25 +38,33 @@ full Omni checkpoint, and CLIP without its vision tower, since neither is used.
|
|
| 38 |
|
| 39 |
```python
|
| 40 |
import torch
|
| 41 |
-
from diffusers import
|
| 42 |
|
| 43 |
-
pipe =
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
-
frames = pipe(image="face.png", audio="speech.wav",
|
| 48 |
```
|
| 49 |
|
| 50 |
-
Pro
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
The speech track is not muxed into the result — add it to the frames yourself.
|
| 56 |
|
| 57 |
-
**
|
| 58 |
-
Until they are, `from_pretrained` cannot resolve the class names in
|
| 59 |
-
`model_index.json`; load the components individually against the port instead.
|
| 60 |
|
| 61 |
## Notes
|
| 62 |
|
|
|
|
| 38 |
|
| 39 |
```python
|
| 40 |
import torch
|
| 41 |
+
from diffusers import ModularPipeline
|
| 42 |
|
| 43 |
+
pipe = ModularPipeline.from_pretrained("kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers")
|
| 44 |
+
pipe.load_components(dtype=torch.bfloat16)
|
| 45 |
+
pipe.to("cuda")
|
| 46 |
|
| 47 |
+
frames = pipe(image="face.png", audio="speech.wav", output="videos")[0]
|
| 48 |
```
|
| 49 |
|
| 50 |
+
Pro does not fit an 80 GB card with every component resident: beside the 7B speech encoder the VAE
|
| 51 |
+
decode of a chunk has nowhere to go. Keep one model on the GPU at a time instead of `pipe.to("cuda")`,
|
| 52 |
+
which brings the peak to about 46 GB:
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
from diffusers import ComponentsManager
|
| 56 |
+
|
| 57 |
+
manager = ComponentsManager()
|
| 58 |
+
pipe = ModularPipeline.from_pretrained("kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers", components_manager=manager)
|
| 59 |
+
pipe.load_components(dtype=torch.bfloat16)
|
| 60 |
+
manager.enable_auto_cpu_offload(device="cuda", offload_strategy=lambda hooks, **_: hooks)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
The pipeline and its blocks come from `modular_model_index.json`. Classifier-free guidance is the `guider` component, not a call argument.
|
| 64 |
|
| 65 |
The speech track is not muxed into the result — add it to the frames yourself.
|
| 66 |
|
| 67 |
+
**Kandinsky S2V 1.0 is not part of a released Diffusers version yet**; it lands as a modular pipeline.
|
|
|
|
|
|
|
| 68 |
|
| 69 |
## Notes
|
| 70 |
|
model_index.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_class_name": "KandinskyS2VPipeline",
|
| 3 |
-
"_diffusers_version": "0.40.0",
|
| 4 |
-
"transformer": [
|
| 5 |
-
"diffusers",
|
| 6 |
-
"KandinskyS2VTransformer3DModel"
|
| 7 |
-
],
|
| 8 |
-
"vae": [
|
| 9 |
-
"diffusers",
|
| 10 |
-
"AutoencoderKLHunyuanVideo"
|
| 11 |
-
],
|
| 12 |
-
"text_encoder": [
|
| 13 |
-
"transformers",
|
| 14 |
-
"Qwen2_5OmniThinkerForConditionalGeneration"
|
| 15 |
-
],
|
| 16 |
-
"tokenizer": [
|
| 17 |
-
"transformers",
|
| 18 |
-
"Qwen2_5OmniProcessor"
|
| 19 |
-
],
|
| 20 |
-
"text_encoder_2": [
|
| 21 |
-
"transformers",
|
| 22 |
-
"CLIPTextModel"
|
| 23 |
-
],
|
| 24 |
-
"tokenizer_2": [
|
| 25 |
-
"transformers",
|
| 26 |
-
"CLIPTokenizer"
|
| 27 |
-
],
|
| 28 |
-
"scheduler": [
|
| 29 |
-
"diffusers",
|
| 30 |
-
"FlowMatchEulerDiscreteScheduler"
|
| 31 |
-
]
|
| 32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modular_model_index.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "KandinskyS2VModularPipeline",
|
| 3 |
+
"_diffusers_version": "0.40.0",
|
| 4 |
+
"_blocks_class_name": "KandinskyS2VAutoBlocks",
|
| 5 |
+
"transformer": [
|
| 6 |
+
"diffusers",
|
| 7 |
+
"KandinskyS2VTransformer3DModel",
|
| 8 |
+
{
|
| 9 |
+
"type_hint": [
|
| 10 |
+
"diffusers",
|
| 11 |
+
"KandinskyS2VTransformer3DModel"
|
| 12 |
+
],
|
| 13 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 14 |
+
"subfolder": "transformer",
|
| 15 |
+
"variant": null,
|
| 16 |
+
"revision": null
|
| 17 |
+
}
|
| 18 |
+
],
|
| 19 |
+
"vae": [
|
| 20 |
+
"diffusers",
|
| 21 |
+
"AutoencoderKLHunyuanVideo",
|
| 22 |
+
{
|
| 23 |
+
"type_hint": [
|
| 24 |
+
"diffusers",
|
| 25 |
+
"AutoencoderKLHunyuanVideo"
|
| 26 |
+
],
|
| 27 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 28 |
+
"subfolder": "vae",
|
| 29 |
+
"variant": null,
|
| 30 |
+
"revision": null
|
| 31 |
+
}
|
| 32 |
+
],
|
| 33 |
+
"text_encoder": [
|
| 34 |
+
"transformers",
|
| 35 |
+
"Qwen2_5OmniThinkerForConditionalGeneration",
|
| 36 |
+
{
|
| 37 |
+
"type_hint": [
|
| 38 |
+
"transformers",
|
| 39 |
+
"Qwen2_5OmniThinkerForConditionalGeneration"
|
| 40 |
+
],
|
| 41 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 42 |
+
"subfolder": "text_encoder",
|
| 43 |
+
"variant": null,
|
| 44 |
+
"revision": null
|
| 45 |
+
}
|
| 46 |
+
],
|
| 47 |
+
"tokenizer": [
|
| 48 |
+
"transformers",
|
| 49 |
+
"Qwen2_5OmniProcessor",
|
| 50 |
+
{
|
| 51 |
+
"type_hint": [
|
| 52 |
+
"transformers",
|
| 53 |
+
"Qwen2_5OmniProcessor"
|
| 54 |
+
],
|
| 55 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 56 |
+
"subfolder": "tokenizer",
|
| 57 |
+
"variant": null,
|
| 58 |
+
"revision": null
|
| 59 |
+
}
|
| 60 |
+
],
|
| 61 |
+
"text_encoder_2": [
|
| 62 |
+
"transformers",
|
| 63 |
+
"CLIPTextModel",
|
| 64 |
+
{
|
| 65 |
+
"type_hint": [
|
| 66 |
+
"transformers",
|
| 67 |
+
"CLIPTextModel"
|
| 68 |
+
],
|
| 69 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 70 |
+
"subfolder": "text_encoder_2",
|
| 71 |
+
"variant": null,
|
| 72 |
+
"revision": null
|
| 73 |
+
}
|
| 74 |
+
],
|
| 75 |
+
"tokenizer_2": [
|
| 76 |
+
"transformers",
|
| 77 |
+
"CLIPTokenizer",
|
| 78 |
+
{
|
| 79 |
+
"type_hint": [
|
| 80 |
+
"transformers",
|
| 81 |
+
"CLIPTokenizer"
|
| 82 |
+
],
|
| 83 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 84 |
+
"subfolder": "tokenizer_2",
|
| 85 |
+
"variant": null,
|
| 86 |
+
"revision": null
|
| 87 |
+
}
|
| 88 |
+
],
|
| 89 |
+
"scheduler": [
|
| 90 |
+
"diffusers",
|
| 91 |
+
"FlowMatchEulerDiscreteScheduler",
|
| 92 |
+
{
|
| 93 |
+
"type_hint": [
|
| 94 |
+
"diffusers",
|
| 95 |
+
"FlowMatchEulerDiscreteScheduler"
|
| 96 |
+
],
|
| 97 |
+
"pretrained_model_name_or_path": "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers",
|
| 98 |
+
"subfolder": "scheduler",
|
| 99 |
+
"variant": null,
|
| 100 |
+
"revision": null
|
| 101 |
+
}
|
| 102 |
+
]
|
| 103 |
+
}
|