A block-based AI canvas for rapid creative exploration. Compose ideas as networks of text and image blocks, connect them into directed acyclic graphs (DAGs), and use AI tools to branch, remix, and evolve those ideas.
Check out the demo below:
# Backend
cd backend
pip install -r requirements.txt
export DATABASE_URL="postgresql://username:password@localhost:5432/diffusiongarden"
export IMAGES_DIR="./images"
export OPENAI_API_KEY="your-key"
export GOOGLE_API_KEY="your-key"
uvicorn app.main:app --reload --port 8000
# Frontend (in another terminal)
cd frontend
npm install
npm run devThe frontend is automatically deployed to GitHub Pages via a GitHub Actions workflow on every push to master that modifies files in frontend/.
Setup:
- In your repo settings, enable GitHub Pages with Source set to GitHub Actions
- Add a repository secret
VITE_API_HOSTwith the backend API URL (e.g.,https://your-backend-domain.railway.app/api) - If using a custom domain, configure it in the Pages settings
The workflow (.github/workflows/deploy-frontend.yml) builds the Vite app and copies index.html to 404.html for SPA routing.
- Go to railway.app and create a new empty project
- Add a PostgreSQL database: New → Database → PostgreSQL
- New → GitHub Repo → Select this repo
- Set Root Directory to
backend - Add environment variables:
OPENAI_API_KEY- Your OpenAI API keyGOOGLE_API_KEY- Your Google AI API keyIMAGES_DIR-/app/imagesFRONTEND_URL- Your GitHub Pages URL (for CORS)DEBUG-false
- Link the PostgreSQL service (auto-injects
DATABASE_URL) - Add a Volume mounted at
/app/imagesfor image storage - Generate a domain
| Variable | Service | Description |
|---|---|---|
DATABASE_URL |
Backend | PostgreSQL connection string (auto from Railway) |
OPENAI_API_KEY |
Backend | OpenAI API key |
GOOGLE_API_KEY |
Backend | Google AI API key |
IMAGES_DIR |
Backend | Path to image storage directory |
FRONTEND_URL |
Backend | GitHub Pages URL for CORS |
DEBUG |
Backend | Set to false for production |
VITE_API_HOST |
Frontend | Backend API URL (set as GitHub repo secret) |