nvsmq commited on
Commit
c6df68f
·
verified ·
1 Parent(s): 9383aa1

Load with ModularPipeline: add modular_model_index.json

Browse files
Files changed (3) hide show
  1. README.md +20 -12
  2. model_index.json +0 -32
  3. 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 KandinskyS2VPipeline
42
 
43
- pipe = KandinskyS2VPipeline.from_pretrained(
44
- "kandinskylab/Kandinsky-S2V-1.0-Pro-Diffusers", torch_dtype=torch.bfloat16
45
- ).to("cuda")
46
 
47
- frames = pipe(image="face.png", audio="speech.wav", num_inference_steps=50).frames[0]
48
  ```
49
 
50
- Pro needs `pipe.enable_model_cpu_offload()` in place of `.to("cuda")` on an 80 GB
51
- card: kept resident beside the 7B speech encoder it leaves the VAE decode of a
52
- chunk nowhere to go, and that decode asks for 7 GiB in one allocation. Offloading
53
- brings the peak from 73 GiB to 46 GiB.
 
 
 
 
 
 
 
 
 
 
54
 
55
  The speech track is not muxed into the result — add it to the frames yourself.
56
 
57
- **The Kandinsky S2V 1.0 classes are not part of a released Diffusers version yet.**
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
+ }