File size: 1,638 Bytes
8b4c5cb
2229af1
 
 
 
8b4c5cb
2229af1
8b4c5cb
 
2229af1
f0a4e91
8b4c5cb
 
2229af1
 
 
 
 
f0a4e91
2229af1
 
 
f0a4e91
 
 
 
 
 
 
2229af1
 
 
f0a4e91
 
 
 
 
 
 
 
 
2229af1
 
f0a4e91
2229af1
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: NFA Track R FLUX.2 Fun CN ZeroGPU
emoji: 🎬
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: "5.49.1"
app_file: app.py
pinned: false
license: other
short_description: Real Fun depth ControlNet fp8+xlarge (NOT soft image=depth)
---

# Track R — FLUX.2 Fun depth ControlNet (ZeroGPU)

**Hard rule:** This Space runs **real** ALIMAMA / VideoX-Fun Fun ControlNet Union depth.
Soft Flux2 `image=depth` is **banned forever** on this path.

## Stack (2026-07-21 host-RAM fix)

| Piece | Value |
|---|---|
| Painter | FLUX.2-dev DiT **streamed to float8** (never full bf16 host materialize) |
| CN | VideoX-Fun `Flux2ControlPipeline` + `FLUX.2-dev-Fun-Controlnet-Union-2602` |
| TE | **Local** quantized `diffusers/FLUX.2-dev-bnb-4bit` (NO HF remote TE) |
| GPU | `@spaces.GPU(duration=300, size="xlarge")` = **96GB** @ **2×** Pro minutes |
| Memory mode | `model_cpu_offload_and_qfloat8` (weights already fp8 at load) |
| Weights | HF Mount `/data/FLUX.2-dev` + `/data/Fun-CN` (+ TE download/cache) |
| Abort | `NFA_FUN_CN_LOAD_DEADLINE_SEC` (default 480) if `Fun CN loaded` not reached |

Requires Space secret **`HF_TOKEN`** (gated FLUX.2-dev license accepted on the account).

## Env

| Var | Default |
|---|---|
| `NFA_FUN_CN_GPU_SIZE` | `xlarge` |
| `NFA_FUN_CN_MEM_MODE` | `model_cpu_offload_and_qfloat8` |
| `NFA_FLUX2_TE_MODEL_ID` | `diffusers/FLUX.2-dev-bnb-4bit` |
| `NFA_FUN_CN_LOAD_DEADLINE_SEC` | `480` |

## API

Same client contract: `/generate_still`  
(`positive`, `negative`, `depth_image`, `seed`, `width`, `height`, `steps`, `guidance`, `cn_strength`)

Depth is **required**. Soft depth is never used.