Spaces:
Running on Zero
Running on Zero
Update README.md
Browse files
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
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
- The model is a 14B autoregressive video diffusion model distilled from Wan 2.1 T2V 14B.
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
| 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 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 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 |
-
##
|
| 46 |
|
| 47 |
-
|
| 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 |
-
##
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|