Skip to content

Pro2004-a11/design_canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Design Canvas 🎨

3D Staging Canvas β†’ AI Product Renders, powered by ComfyUI

Design Canvas β€” demo

Python FastAPI Three.js ComfyUI SDXL


πŸ–₯️ Performance Environment

GPU VRAM OS License


✨ Overview

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.


πŸš€ Key Features

🧱 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).

🧩 How It Works

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   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             β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Stage β€” place 3D objects and set the lighting/camera.
  2. Sketch β€” switch to the Drawing layer and annotate what to add.
  3. Prompt β€” describe the desired effect and style.
  4. Generate β€” the canvas composite is sent to ComfyUI for img2img diffusion.
  5. 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.


πŸ“Έ Screenshots

Creative & AI Product Shot
A|B preview β€” staged 3D vs. finished AI render Product Shot β€” Eames lounge, studio finish
Any AI Tool Game Designer
ControlNet Canny β€” structure-locked render Concept art β€” fantasy bottle set

Local AI Render

Local AI render β€” fully on-device, zero cloud


⚑ Quick Start

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.py

Open http://127.0.0.1:5000 in your browser.

On the ComfyUI side

Design Canvas does not ship a model β€” it only drives a ComfyUI instance. Before running the server, make sure ComfyUI is set up:

  1. Install ComfyUI β€” see the official guide.
  2. Add an SDXL checkpoint β€” drop a .safetensors file into ComfyUI/models/checkpoints/. RealVisXL, Juggernaut XL or DreamShaper XL give the best product-render results. The server auto-detects it.
  3. (Optional) ControlNet β€” for the structure-locked Canny mode, install an SDXL ControlNet model into ComfyUI/models/controlnet/.
  4. 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/ComfyUI

Prefer to manage it yourself? Just start ComfyUI manually on port 8188 before launching server.py β€” the server will detect and reuse it.

Or start ComfyUI manually on port 8188 before launching the server.


πŸ“‚ Project Structure

/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

πŸ› οΈ Tech Stack

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)

πŸ—ΊοΈ Roadmap

  • 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

πŸ“„ License

Released under the MIT License.


Built by Yosi Refaeli Β· Senior Technical Artist & AI Systems

About

3D staging canvas to AI product renders, powered by ComfyUI + SDXL

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors