Website | Playground | API Docs
SDCN is an infrastructure for sharing Stable Diffusion computing power
- Decentralization: By running the SDCN node program, users can register their idle computing resources with the SDCN network
- Trustlessness: SDCN abstracts the capabilities of Stable Diffusion into a set of atomic interface calls and hides the computing process from application developers
- Powerful: Application developers can quickly develop their own applications based on the Stable Diffusion related capabilities provided by SDCN, without worrying about how these interfaces are implemented or how computing power is provided
- SDCN Node
- Executes image generation tasks
- Use Stable Diffusion WebUI with API mode directly
- SDCN Server
- Manage and route image generation tasks to SDCN Nodes
- Hide the image generating details and expose a standard interface to application developers
- Implement SDCN server with openresty
- API
- txt2img
- img2img
- integrate
- more APIs under developing
Why SDCN?
- Everyone should have the ability to use AI freely, AI will be a public good
- For the public, the cost of trying various ways of stable diffusion is too high
- It's difficult to set up a stable diffusion runtime environment on your own
- Computer performance may not support it
- Downloading code from GitHub and running Stable Diffusion WebUI is beyond the ability of most non-programmers(even programmers)
- Learning about models and prompt knowledge requires high learning costs
- More application developers should be supported in popularizing AI capabilities to the public
- For application developers, the cost of building a publicly available image generation service is too high
- Application developers should focus on implementing business requirements
- The utilization of GPU computing power for home and cloud procurement is very low, leading to significant wastage
Try out SDCN functionalities in SDCN website.
🎈Feel free to file tickets for bugs or feature requests.
SDCN provide SaaS-like API from https://api.sdcn.info
Try the sample code in example
folder.
You can modify the example/params-xxx.json
to experiment with different parameter combinations.
python3 dan_run.py txt2img params-txt2img.json OUTPUT_IMAGE.png
python3 dan_run.py img2img params-img2img.json ORIGINAL_IMAGE.png OUTPUT_IMAGE.png
- Install
curl
andjq
brew install curl jq
- Enter
example
folder and execute
cd example
cat params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/api/sd/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.data.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png
👉 SDCN API refer to API Docs
- Register a
donor account
on sdcn.info - Install lastest Stable Diffusion WebUI on your PC or Server
- Start according to README.md in the dan-node file
-
Install lastest Stable Diffusion WebUI and Docker on your PC or Server
-
Register a
donor account
on sdcn.info -
Start according to README.md in the dan-node file
-
Register a new github OAuth Application set callback url: http://localhost:6006/api/user/connect/github. Get the github client ID and SECRET:, then set in the docker-compose.yml.
-
Start dan-server locally in docker with Docker Compose:
docker-compose up -d
Now your dan-server is available on "http://127.0.0.1:6006"
- Register your Stable Diffusion WebUI instance as a SDCN node:
- Login your account using SDCN's web page: http://127.0.0.1:6006;
- Navigate to
Nodes
->Donate Node
- Enter your worker node's address
- Click
Donate
⚠️ Please note that you must use non-loopback IP address in your node's address! You cannot use 127.0.0.1 or 'localhost' since our docker container'shostnet
is not enabled.
- Config SERVICE_PREFIX in
example/dan_run.py
to "http://127.0.0.1:6006".
SERVICE_PREFIX = 'http://127.0.0.1:6006'
- Execute the example with your local dan-server:
python3 dan_run.py txt2img params-txt2img.json OUTPUT_IMAGE.png
- Rename project to SDCN
- Management GUI for computing power donors
- Add login to the SDCN website
- CRUD management of computing power provided by donors
- Workload ranking page
- Node-based workload ranking
- Donor-based workload ranking
- Model-based workload ranking
- API-based workload ranking
- Basic SDCN functional interfaces
- Scale interface
- Inpaint interface
- Support for controlnet
- Enrich examples in the playground
- 2D to 3D style conversion
- 3D to 2D style conversion
- One-click installation of Stable Diffusion WebUI as an SDCN node (Windows & Linux supported)
- Customize Stable Diffusion WebUI installer
- Automatically download necessary model files
- Customize SDCN node daemon as intermediary for communication between Stable Diffusion WebUI and SDCN server
- Image Stream (user generated by the SDCN tool and share to sdcn.info)
- Sharing mechanisms for images generated through API or playground
- A page to display shared images in a waterfall flow
- Constraints for the use of computing resources
- API-Key mechanism
- honor(credit) system
- Task scheduling mechanism
- Schedule to nodes with required models already loaded
- Global load balancing
This project is licensed under the MIT license
- Stable Diffusion - https://github.com/CompVis/stable-diffusion
- Stable Diffusion web UI - https://github.com/AUTOMATIC1111/stable-diffusion-webui
- Ant Design - https://github.com/ant-design/ant-design