3D Staging Canvas β AI Product Renders, powered by ComfyUI
Design Canvas turns a lightweight 3D staging scene into a finished, photorealistic
product render. Place primitives or imported OBJ/GLB models on a canvas, sketch the
details you want, write a prompt β and the composite is handed off to ComfyUI for
SDXL generation.
The server itself is a thin FastAPI bridge: it owns zero VRAM. ComfyUI is auto-launched as a subprocess and manages all GPU work independently, so the app stays responsive while the GPU is fully committed to diffusion.
The idea: block out a scene like a 3D artist, then let diffusion do the lighting, materials, and finish like a studio photographer.
| π§± 3D Staging | Box / sphere / cylinder / cone primitives, plus OBJ (+MTL) and GLB (+textures) import via drag-and-drop. |
| βοΈ Drawing Layer | Pencil, eraser, line, arrow and text tools to annotate intent directly on the canvas. Undo/redo (Ctrl+Z / Ctrl+Y). |
| π‘ Lighting Rig | Direction, intensity, height, angle, color and ambient controls β staged before generation. |
| π₯ Camera Presets | Front, 3/4, Side, Top, Hero and Isometric views with animated transitions. |
| πΌοΈ Style Presets | Studio Photo, Lifestyle, Hero Shot, Flat Lay, Catalog and Neon looks. |
| βοΈ Workflow Swapping | Ships with an SDXL img2img workflow; upload any custom ComfyUI workflow JSON. |
| π Live Progress | Real-time WebSocket progress bar streamed straight from ComfyUI. |
| π A|B Compare | Before/after comparison slider and a gallery lightbox for every result. |
| π― Reproducible | Seed control, negative prompt field and checkpoint selector (auto-detected). |
βββββββββββββββ composite PNG ββββββββββββββββ API workflow βββββββββββββ
β 3D Canvas β ββββββββββββββββΆ β FastAPI β βββββββββββββββΆ β ComfyUI β
β (Three.js) β base64 over β bridge β /prompt β (SDXL) β
β + Drawing β HTTP β (0 GB VRAM) β ββββββββββββββββββ GPU β
βββββββββββββββ ββββββββββββββββ result image βββββββββββββ
β² β WebSocket progress β
ββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ
- Stage β place 3D objects and set the lighting/camera.
- Sketch β switch to the Drawing layer and annotate what to add.
- Prompt β describe the desired effect and style.
- Generate β the canvas composite is sent to ComfyUI for img2img diffusion.
- Compare β review in the gallery, A|B against the source, download as PNG.
Workflow placeholders injected at runtime: CANVAS_IMAGE, POSITIVE_PROMPT,
NEGATIVE_PROMPT, CHECKPOINT_NAME.
![]() |
![]() |
| A|B preview β staged 3D vs. finished AI render | Product Shot β Eames lounge, studio finish |
![]() |
![]() |
| ControlNet Canny β structure-locked render | Concept art β fantasy bottle set |
Local AI render β fully on-device, zero cloud
Requirements: Python 3.10+, a working ComfyUI install, and an SDXL checkpoint (RealVisXL, Juggernaut XL or DreamShaper XL recommended).
# 1. Clone
git clone https://github.com/Pro2004-a11/design_canvas.git
cd design_canvas
# 2. Create the environment
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux / macOS
source .venv/bin/activate
# 3. Install dependencies (no torch/diffusers β ComfyUI owns the GPU)
pip install -r requirements.txt
# 4. Run
python server.pyOpen http://127.0.0.1:5000 in your browser.
Design Canvas does not ship a model β it only drives a ComfyUI instance. Before running the server, make sure ComfyUI is set up:
- Install ComfyUI β see the official guide.
- Add an SDXL checkpoint β drop a
.safetensorsfile intoComfyUI/models/checkpoints/. RealVisXL, Juggernaut XL or DreamShaper XL give the best product-render results. The server auto-detects it. - (Optional) ControlNet β for the structure-locked Canny mode, install an
SDXL ControlNet model into
ComfyUI/models/controlnet/. - Port β ComfyUI must be reachable on
127.0.0.1:8188(its default).
The server auto-launches ComfyUI for you. Point it at your install:
# Windows
set COMFYUI_DIR=C:\path\to\ComfyUI
# Linux / macOS
export COMFYUI_DIR=/path/to/ComfyUIPrefer to manage it yourself? Just start ComfyUI manually on port
8188before launchingserver.pyβ the server will detect and reuse it.
Or start ComfyUI manually on port 8188 before launching the server.
/design_canvas
βββ server.py # FastAPI β ComfyUI bridge (0 GB VRAM)
βββ app.html # Single-page 3D canvas UI (Three.js r162)
βββ requirements.txt # Python dependencies
βββ workflows/ # ComfyUI workflow JSONs (swappable at runtime)
βββ _templates/ # Example workflow templates
βββ uploads/ # Imported OBJ/GLB models (git-ignored)
βββ docs/
βββ make_placeholders.py # Screenshot placeholder generator
βββ screenshots/ # README imagery
| Layer | Technology |
|---|---|
| Frontend | HTML5 Canvas, Three.js r162, OBJLoader / GLTFLoader |
| Backend | Python 3.10+, FastAPI, Uvicorn, aiohttp |
| Generation | ComfyUI, Stable Diffusion XL (img2img, DPM++ 2M Karras) |
| Transport | HTTP + WebSocket (live progress) |
- IP-Adapter for true reference-image style transfer
- Post-composite product protection (mask-based blending)
- Batch generation β multiple seeds per request
- Environment maps / HDRI lighting
Released under the MIT License.
Built by Yosi Refaeli Β· Senior Technical Artist & AI Systems





