{"id":22675639,"url":"https://github.com/satyajitghana/sd3-ui","last_synced_at":"2026-04-12T04:33:33.321Z","repository":{"id":266871429,"uuid":"899608244","full_name":"satyajitghana/sd3-ui","owner":"satyajitghana","description":"Modern web interface for Stable Diffusion 3 text-to-image generation. Features real-time progress tracking, local storage, and a sleek dark mode UI. Built with Next.js 15, FastAPI, and TorchServe.","archived":false,"fork":false,"pushed_at":"2024-12-06T16:19:09.000Z","size":8520,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T13:43:35.610Z","etag":null,"topics":["deeplearning","fastapi","gen-ai","image-generation","nextjs","nextjs15","python","stable-diffusion","stable-diffusion-3","text-to-image","torchserve","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/satyajitghana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-06T16:09:50.000Z","updated_at":"2024-12-06T16:22:53.000Z","dependencies_parsed_at":"2024-12-06T17:38:51.346Z","dependency_job_id":null,"html_url":"https://github.com/satyajitghana/sd3-ui","commit_stats":null,"previous_names":["satyajitghana/sd3-ui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyajitghana%2Fsd3-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyajitghana%2Fsd3-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyajitghana%2Fsd3-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyajitghana%2Fsd3-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satyajitghana","download_url":"https://codeload.github.com/satyajitghana/sd3-ui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246187216,"owners_count":20737459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deeplearning","fastapi","gen-ai","image-generation","nextjs","nextjs15","python","stable-diffusion","stable-diffusion-3","text-to-image","torchserve","typescript"],"created_at":"2024-12-09T17:58:14.236Z","updated_at":"2025-12-30T23:18:29.364Z","avatar_url":"https://github.com/satyajitghana.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TSAI Stable Diffusion 3 UI\n\nA modern web interface for Stable Diffusion 3 text-to-image generation, built with Next.js and FastAPI.\n\n![UI Screenshot](assets/image.png)\n![Generated Images](assets/image-2.png)\n\n## Project Structure\n\n```\n.\n├── .              # Next.js frontend\n├── model-server/        # FastAPI and TorchServe backend\n│   ├── server.py       # FastAPI server\n│   ├── config.properties\n│   └── sd3_handler.py  # TorchServe handler\n└── README.md\n```\n\n## Quick Start\n\n### 1. Setting up the Frontend (sd3-ui)\n\n```bash\ncd sd3-ui\nnpm install\nnpm run dev\n```\n\nThe UI will be available at http://localhost:3000\n\n### 2. Setting up the Backend\n\n#### 2.1 Preparing the Model\n\nFirst, download the Stable Diffusion 3 model:\n\n```bash\ncd model-server\n```\n\n```python\n#!/usr/bin/env python3\nfrom diffusers import StableDiffusion3Pipeline\nimport torch\n\npipe = StableDiffusion3Pipeline.from_pretrained(\n    \"stabilityai/stable-diffusion-3-medium-diffusers\", \n    torch_dtype=torch.bfloat16\n)\npipe.save_pretrained(\"./sd3-model\")\n```\n\nThen zip the model artifacts:\n\n```bash\ncd sd3-model\nzip -0 -r ../sd3-model.zip *\n```\n\n#### 2.2 Creating the Model Archive (.mar)\n\nStart a TorchServe container:\n\n```bash\ndocker run -it --rm --shm-size=1g \\\n    --ulimit memlock=-1 \\\n    --ulimit stack=67108864 \\\n    --gpus all \\\n    -v `pwd`:/opt/src \\\n    pytorch/torchserve:0.12.0-gpu bash\n```\n\nCreate the model archive:\n\n```bash\ncd /opt/src\ntorch-model-archiver --model-name sd3 \\\n    --version 1.0 \\\n    --handler sd3_handler.py \\\n    --extra-files sd3-model.zip \\\n    -r requirements.txt \\\n    --archive-format zip-store\n```\n\n#### 2.3 Starting TorchServe\n\n```bash\ndocker run --rm --shm-size=1g \\\n    --ulimit memlock=-1 \\\n    --ulimit stack=67108864 \\\n    -p8080:8080 \\\n    -p8081:8081 \\\n    -p8082:8082 \\\n    -p7070:7070 \\\n    -p7071:7071 \\\n    --gpus all \\\n    -v /path/to/config.properties:/home/model-server/config.properties \\\n    --mount type=bind,source=/path/to/models,target=/tmp/models \\\n    pytorch/torchserve:0.12.0-gpu \\\n    torchserve --model-store=/tmp/models\n```\n\n#### 2.4 Starting the FastAPI Server\n\nInstall requirements:\n\n```bash\npip install -r requirements-server.txt\n```\n\nStart the server:\n\n```bash\ncd model-server\npython server.py\n```\n\nThe FastAPI server will be available at http://localhost:9080\n\n## Features\n\n- 🎨 Modern, responsive UI with dark mode\n- 🖼️ Real-time generation progress\n- 💾 Local storage for generated images\n- ⬇️ Download generated images\n- 🗑️ Delete unwanted generations\n- ⏱️ Generation time tracking\n\n## Environment Variables\n\nCreate a `.env.local` file in the sd3-ui directory:\n\n```env\nBACKEND_URL=http://localhost:9080\n```\n\n## API Endpoints\n\n- `POST /text-to-image`: Generate image from text prompt\n- `GET /results/{job_id}`: Get generation results\n- `GET /health`: Health check endpoint\n\n## Requirements\n\n### Frontend\n- Node.js 22\n- npm or yarn\n\n### Backend\n- Python 3.11+\n- CUDA-compatible GPU\n- Docker\n- See `requirements-server.txt` for Python packages\n\n## Development\n\nThe frontend uses Next.js 15 with App Router and is styled using Tailwind CSS and shadcn/ui components. The backend uses FastAPI for the API server and TorchServe for model serving.\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatyajitghana%2Fsd3-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatyajitghana%2Fsd3-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatyajitghana%2Fsd3-ui/lists"}