fffiloni commited on
Commit
38f52d8
·
verified ·
1 Parent(s): 88c4d82

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +126 -31
README.md CHANGED
@@ -5,50 +5,145 @@ colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
  app_file: app.py
 
8
  hardware: zerogpu
9
  python_version: "3.10.13"
10
- short_description: "Realtime T2V demo via diffusers ModularPipeline"
11
  ---
12
 
13
- # Krea Realtime Video 14B
14
 
15
- This Space implements **real local inference** for [krea/krea-realtime-video](https://huggingface.co/krea/krea-realtime-video) using the official 🧨 Diffusers `ModularPipeline` path from the model card.
16
 
17
- ## What it does
18
 
19
- - **Text-to-video**: enter a prompt, choose how many blocks (≈ frames) to generate, and hit **Generate Video**.
20
- - The model is a 14B autoregressive video diffusion model distilled from Wan 2.1 T2V 14B.
21
 
22
- ## How to try it
 
 
 
 
 
 
 
23
 
24
- 1. Open the **Generate Video** tab.
25
- 2. Type a prompt (e.g. *"a cat sitting on a boat"*).
26
- 3. Adjust **Number of Blocks** (1–9) and **Inference Steps per Block** (1–20).
27
- - Lower values = faster and cheaper first test.
28
- 4. Click **Generate Video**.
29
 
30
- **Example inputs**
31
- - `a cat sitting on a boat` (3 blocks, 4 steps, seed 42)
32
- - `a futuristic city at sunset` (3 blocks, 4 steps, seed 123)
33
- - `a panda playing guitar in a forest` (2 blocks, 4 steps, seed 7)
 
 
 
 
34
 
35
- ## Limitations & known risks
36
 
37
- - **VRAM**: the 14B transformer (~28 GB in bf16) plus the UMT5-XXL text encoder (~12–14 GB) and VAE push the full pipeline well above 48 GB. Standard HF Space GPU tiers are **unlikely to fit** the model without aggressive quantization or >96 GB of VRAM.
38
- - **Hardware recommendation**: this demo should be run on a Space with a very large GPU (e.g. `xlarge` ZeroGPU tier or a dedicated high-memory GPU).
39
- - If the pipeline fails to load, the `/health` endpoint and the UI surface the **concrete load error** (OOM, CUDA init, missing import, etc.).
40
- - The model card’s recommended optimizations (`torch.compile`, SageAttention, FP8 quantization with `torchao`) are **not enabled** here because:
41
- - `torch.compile` is [not supported on ZeroGPU](https://huggingface.co/blog/zerogpu-aoti).
42
- - `flash-attn` / `kernels` / `torchao` are native-build dependencies that frequently fail in HF Space build environments.
43
- - We therefore rely on the **SDPA fallback** and vanilla bf16/fp16 precision.
44
 
45
- ## Architecture
46
 
47
- - `app.py` loads `ModularPipeline.from_pretrained(..., trust_remote_code=True)` at module level so ZeroGPU can pack resident tensors.
48
- - Generation is guarded by `@spaces.GPU` and uses iterative `PipelineState` blocks exactly as the model card demonstrates.
49
- - Health (`api_name="health"`) is instant and never touches weights.
50
 
51
- ## Dependencies
52
 
53
- - `diffusers` (main branch from GitHub)
54
- - `torch`, `transformers`, `accelerate`, `safetensors`, `spaces`, `gradio`, `tqdm`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  colorTo: purple
6
  sdk: gradio
7
  app_file: app.py
8
+ pinned: false
9
  hardware: zerogpu
10
  python_version: "3.10.13"
 
11
  ---
12
 
13
+ # Krea Realtime Video
14
 
15
+ A Hugging Face Space for generating short videos with [`krea/krea-realtime-video`](https://huggingface.co/krea/krea-realtime-video), using Diffusers `ModularPipeline` and ZeroGPU.
16
 
17
+ This demo runs local text-to-video inference inside the Space and includes optional LoRA support for the Origami style.
18
 
19
+ ## Features
 
20
 
21
+ - Text-to-video generation with Krea Realtime Video 14B
22
+ - Diffusers `ModularPipeline` integration
23
+ - ZeroGPU-compatible runtime
24
+ - Manual style loading before generation
25
+ - Optional Origami LoRA support
26
+ - Automatic `[origami]` trigger insertion when the Origami style is active
27
+ - Adjustable video length and quality controls
28
+ - Progress feedback during generation
29
 
30
+ ## How to use
 
 
 
 
31
 
32
+ 1. Enter a prompt describing the video you want to generate.
33
+ 2. Optionally select a style.
34
+ 3. If you select **Origami**, click **Load style** before generating.
35
+ 4. Adjust:
36
+ - **Length**: number of video blocks
37
+ - **Quality**: inference steps per block
38
+ - **Seed**: reproducibility seed
39
+ 5. Click **Generate video**.
40
 
41
+ The generated video will appear on the right side of the interface.
42
 
43
+ ## Styles
 
 
 
 
 
 
44
 
45
+ ### Base model
46
 
47
+ Uses the original Krea Realtime Video model without any additional LoRA.
 
 
48
 
49
+ ### Origami
50
 
51
+ Uses the Origami LoRA adapter:
52
+
53
+ [`shauray/Origami_WanLora`](https://huggingface.co/shauray/Origami_WanLora)
54
+
55
+ When this style is active, the app automatically prefixes the prompt with:
56
+
57
+ ```text
58
+ [origami]
59
+ ```
60
+
61
+ For example, this prompt:
62
+
63
+ ```text
64
+ a cat sitting on a boat
65
+ ```
66
+
67
+ is internally sent as:
68
+
69
+ ```text
70
+ [origami] a cat sitting on a boat
71
+ ```
72
+
73
+ ## Recommended settings
74
+
75
+ For a balanced result:
76
+
77
+ ```text
78
+ Length: 9
79
+ Quality: 6
80
+ Seed: any fixed integer
81
+ ```
82
+
83
+ Lower values generate faster. Higher values may improve temporal consistency and visual quality, but can take longer.
84
+
85
+ ## Example prompts
86
+
87
+ ```text
88
+ Astronaut in a jungle, cold color palette, muted colors, detailed, cinematic, 8k
89
+ ```
90
+
91
+ ```text
92
+ A tiny wooden boat drifting through a misty lake at sunrise, a curious cat sitting at the front, soft cinematic lighting, calm water reflections
93
+ ```
94
+
95
+ ```text
96
+ A futuristic city at sunset, flying vehicles between glass towers, neon reflections, cinematic camera movement, atmospheric haze
97
+ ```
98
+
99
+ ```text
100
+ A car racing down a snowy mountain road, dramatic chase shot, powder snow flying behind the wheels, cold blue lighting, high speed motion
101
+ ```
102
+
103
+ ```text
104
+ A surreal underwater library, glowing jellyfish floating between bookshelves, slow cinematic dolly shot, dreamlike atmosphere
105
+ ```
106
+
107
+ Origami examples:
108
+
109
+ ```text
110
+ a cat sitting on a boat
111
+ ```
112
+
113
+ ```text
114
+ a dragon flying over a mountain village at sunrise, paper-folded geometry, delicate handmade texture, soft shadows
115
+ ```
116
+
117
+ ```text
118
+ a small fox walking through a paper forest, handcrafted origami style, warm lantern light, cinematic close-up
119
+ ```
120
+
121
+ ## Implementation notes
122
+
123
+ This Space uses a ZeroGPU compatibility path.
124
+
125
+ The original optimized inference path for Krea Realtime Video relies on features such as `torch.compile` and optimized attention kernels. In this Space, `torch.compile` is intentionally disabled to keep the runtime compatible with ZeroGPU.
126
+
127
+ The model is loaded when the Space starts. LoRA styles are loaded manually through the UI before generation, so the generation step can focus on inference.
128
+
129
+ ## Limitations
130
+
131
+ - The demo is intended for short video generation.
132
+ - Very long generations may be slower or less stable.
133
+ - The Origami style must be loaded once before it can be used.
134
+ - LoRA strength control is not exposed in the UI because the current adapter API used by this runtime does not reliably support per-adapter weights.
135
+ - ZeroGPU compatibility may be slower than a fully optimized dedicated GPU deployment.
136
+
137
+ ## Model
138
+
139
+ Base model:
140
+
141
+ [`krea/krea-realtime-video`](https://huggingface.co/krea/krea-realtime-video)
142
+
143
+ Optional LoRA:
144
+
145
+ [`shauray/Origami_WanLora`](https://huggingface.co/shauray/Origami_WanLora)
146
+
147
+ ## Acknowledgements
148
+
149
+ This Space is built on top of the Hugging Face ecosystem, including Diffusers, Gradio, PEFT, and the Hugging Face Hub.