{"id":35125293,"url":"https://github.com/tchung1970/sd-cli-cuda","last_synced_at":"2026-05-09T23:01:14.401Z","repository":{"id":330759576,"uuid":"1123863972","full_name":"tchung1970/sd-cli-cuda","owner":"tchung1970","description":"CUDA-accelerated Stable Diffusion plugin for wavespeed-desktop","archived":false,"fork":false,"pushed_at":"2025-12-28T17:30:15.000Z","size":38301,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-29T19:13:07.842Z","etag":null,"topics":["cuda","gpu","linux","nvidia","stable-diffusion"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/tchung1970.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-27T19:44:12.000Z","updated_at":"2025-12-28T17:30:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tchung1970/sd-cli-cuda","commit_stats":null,"previous_names":["tchung1970/sd-cpp-cuda"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tchung1970/sd-cli-cuda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchung1970%2Fsd-cli-cuda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchung1970%2Fsd-cli-cuda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchung1970%2Fsd-cli-cuda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchung1970%2Fsd-cli-cuda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tchung1970","download_url":"https://codeload.github.com/tchung1970/sd-cli-cuda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchung1970%2Fsd-cli-cuda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cuda","gpu","linux","nvidia","stable-diffusion"],"created_at":"2025-12-28T02:27:39.843Z","updated_at":"2026-05-09T23:01:14.391Z","avatar_url":"https://github.com/tchung1970.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sd-cli-cuda\n\nCUDA-accelerated Stable Diffusion plugin for [wavespeed-desktop](https://github.com/WaveSpeedAI/wavespeed-desktop).\n\n## Overview\n\nThis is a **modular plugin** designed to add CUDA GPU acceleration to wavespeed-desktop on any Linux system with an NVIDIA GPU such as RTX 4000 Ada Generation.\n\nThe package provides [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) compiled with CUDA support, enabling high-performance local image generation through wavespeed-desktop with Z-Image for local image generation.\n\n### How It Works\n\n1. **Standalone binary**: Installs `sd-cli` to `/usr/bin/`\n2. **Auto-integration**: Creates symlink at `~/.config/wavespeed-desktop/sd-bin/sd` for wavespeed-desktop to detect\n3. **Modular design**: wavespeed-desktop automatically uses the CUDA backend when available\n\n### Build Process\n\nThe build script:\n1. Clones the latest stable-diffusion.cpp source\n2. Compiles with CUDA GPU acceleration\n3. Packages into a `.deb` file for easy installation on Debian/Ubuntu systems\n\n## Prerequisites\n\n### System Requirements\n- Debian/Ubuntu-based Linux distribution such as Ubuntu 24.04 LTS\n- NVIDIA GPU with CUDA support such as RTX 4000 Ada Generation\n\n### Build Dependencies\n\n```bash\nsudo apt update\nsudo apt install -y \\\n    build-essential \\\n    cmake \\\n    git \\\n    nvidia-cuda-toolkit \\\n    dpkg-dev\n```\n\n### Runtime Dependencies\n- `libc6`\n- `libstdc++6`\n- `libgomp1`\n- `libcudart12` - CUDA runtime library\n- `libcublas12` - CUDA BLAS library\n- `libcublaslt12` - CUDA BLAS LT library\n- NVIDIA drivers (with CUDA support)\n- `zenity` - VRAM error popup dialog (pre-installed on Ubuntu 24.04 GNOME)\n- `xdotool` - popup window centering (auto-installed by postinst if missing)\n\nCUDA libraries are automatically installed when using `apt install ./sd-cli-cuda_*.deb`.\n\n## Building\n\n```bash\n./build.sh\n```\n\nThe script will:\n1. Clone stable-diffusion.cpp to `./src/` (shallow clone)\n2. Build with CUDA enabled using all available CPU cores\n3. Create `sd-cli-cuda_amd64.deb` in the repo root\n\nBuild time: ~3-5 minutes depending on hardware.\n\n## Installation\n\n```bash\n# Recommended: auto-installs CUDA dependencies\nsudo apt install ./sd-cli-cuda_1.0.2_amd64.deb\n\n# Or manually (requires CUDA libs already installed)\nsudo dpkg -i sd-cli-cuda_1.0.2_amd64.deb\n```\n\n### What Gets Installed\n\n| Path | Description |\n|------|-------------|\n| `/usr/bin/sd-cli` | Command-line image generation tool |\n| `~/.config/wavespeed-desktop/sd-bin/sd` | Symlink to sd-cli (for wavespeed-desktop integration) |\n\nAfter installation, wavespeed-desktop will automatically detect and use the CUDA backend for GPU-accelerated image generation.\n\n## Uninstallation\n\n```bash\nsudo dpkg -r sd-cli-cuda\n```\n\n## Usage\n\n### With wavespeed-desktop (Recommended)\n\nSimply install the package - wavespeed-desktop will automatically detect and use the CUDA backend. No additional configuration required.\n\n### sd-cli (Standalone Command Line)\n\nSee [example.txt](example.txt) for a complete command-line example using wavespeed-desktop model paths.\n\nSample output (generated on NVIDIA RTX 4000 Ada Generation):\n\n![output.png](output.png)\n\n## Package Details\n\n| Field | Value |\n|-------|-------|\n| Package Name | sd-cli-cuda |\n| Version | 1.0.2 |\n| Architecture | amd64 |\n| License | MIT (upstream) |\n| Source | https://github.com/leejet/stable-diffusion.cpp |\n\n## Troubleshooting\n\n### CUDA not found during build\nEnsure CUDA toolkit is installed:\n```bash\nnvcc --version\n```\n\n### GPU not detected at runtime\nCheck NVIDIA driver:\n```bash\nnvidia-smi\n```\n\n### Out of VRAM\nsd-cli checks GPU memory before running and requires 8GB free. When VRAM is insufficient:\n\n1. wavespeed-desktop shows `CUDA Out of Memory!` in the error banner\n2. A popup dialog appears with full details:\n   - Free/total VRAM in GB\n   - List of GPU processes consuming VRAM (PID, name, usage)\n   - Command to free VRAM\n\nTo free VRAM, close GPU-intensive applications:\n```bash\nsudo pkill -f 'main.py'  # ComfyUI\n```\n\n## Related Projects\n\n- [wavespeed-desktop](https://github.com/WaveSpeedAI/wavespeed-desktop) - Desktop application for local AI image generation\n- [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp) - Upstream C++ implementation\n\n## License\n\nsd-cli-cuda is licensed under MIT License.\n\nstable-diffusion.cpp is licensed under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftchung1970%2Fsd-cli-cuda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftchung1970%2Fsd-cli-cuda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftchung1970%2Fsd-cli-cuda/lists"}