huggingface-projects/diffusiongemma-3d-gen
8
1---2title: Gemma Diffusion 3D Asset Builder3emoji: ๐ง4colorFrom: indigo5colorTo: purple6sdk: gradio7sdk_version: 6.17.38python_version: "3.12"9app_file: app.py10pinned: false11short_description: Diffuse an SVG game asset and watch it extrude into live 3D12---13 14# Gemma Diffusion ยท Text โ 3D Asset15 16A live, side-by-side visualization of **block-diffusion** generation. Describe a game17asset (a sword, potion, treasure chest, spaceship, ...) and the model designs an original18**SVG** illustration by denoising a canvas of random tokens โ every position updates *at19once* each step. A fixed, hand-written **Three.js** harness then extrudes that SVG into an20interactive, spinning 3D object.21 22The left pane shows the raw SVG *canvas* diffusing token-by-token (the signature look of23text diffusion); the right pane shows the extruded 3D scene (drag to orbit). Type a24follow-up to **tweak in place**: the previous artwork seeds the diffusion's starting canvas25(via the model's native `canvas_ids` API), so the model edits the existing asset instead of26regenerating from scratch.27 28## Stack29 30- **Model**: `google/diffusiongemma-26B-A4B-it` (`DiffusionGemmaForBlockDiffusion`).31- **Backend**: [`gradio.Server`](https://huggingface.co/blog/introducing-gradio-server)32 โ a FastAPI subclass that provides Gradio's queue + SSE streaming under a custom,33 hand-written HTML/CSS/JS frontend (`index.html`). The single streaming endpoint34 `/generate` yields one JSON frame per denoising step. The model only has to produce the35 SVG art; the frontend owns the (reliable) 3D extrusion, so the scene always renders.36- **Hardware**: ZeroGPU (`xlarge`) โ the 26B checkpoint needs the full backing card.37 38A custom `transformers` wheel providing the DiffusionGemma architecture is bundled in39this repo and installed at runtime by `app.py` (Spaces installs `requirements.txt` before40the repo files are copied in, so a local-path wheel can't be referenced there).41 42## Configuration43 44- `HF_TOKEN` (secret) โ read access to the private model repo.45- `GRADIO_SSR_MODE=false` (variable) โ required so the custom `/` route serves46 `index.html` instead of Gradio's SSR shell.47- `GDIFF_MODEL_PATH` (optional) โ override the model repo id.48- `GDIFF_GPU_SIZE` (optional) โ ZeroGPU slice, defaults to `xlarge`.49 