fiatrete / SDCN-Stable-Diffusion-Computing-Network

SDCN is an infrastructure that allows people to share and use Stable Diffusion computing power easily.
https://sdcn.info
MIT License
32 stars 12 forks source link

It looks like a remote command-line version of Stable Diffusion. #3

Open Ox2098 opened 1 year ago

Ox2098 commented 1 year ago

I'm not sure what mechanism is used to call api.sdcn.info, and I hope that the code will be made open source. I've been studying Stable Diffusion WebUI recently, and since it is a local service, some modifications are required to provide network services. Your project meets my needs.

That's a great suggestion! It would be helpful if you could provide a "requirements.txt" file for easy deployment.

generated by the default param are really impressive! out

fiatrete commented 1 year ago

Are you going to deploy SDCN in your private network to manage your Stable Diffusion webui instances?

Ox2098 commented 1 year ago

Anything is possible, it all depends on the needs of the business.

I just want something more flexible and lightweight. I'm planning to use curl to make requests, as it's simpler that way

troy6en commented 1 year ago

Anything is possible, it all depends on the needs of the business.

I just want something more flexible and lightweight. I'm planning to use curl to make requests, as it's simpler that way

You could use curl to make requests, but you'll need a little more tools to accomplish the full txt2img processes. The commands below may help you.

Install the requirements

I assume you are using macOS.

brew install curl jq

Execute img2txt via cmd

One click solution

curl https://raw.githubusercontent.com/fiatrete/SDCN-Stable-Diffusion-Computing-Network/main/example/params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png

If you want to do some adjustments, you could download the template first.

curl -O https://raw.githubusercontent.com/fiatrete/SDCN-Stable-Diffusion-Computing-Network/main/example/params-txt2img.json

Another one click solution after modified the json

cat params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png

I think they are pretty simple. I have generated lots of images via cmd :)

fiatrete commented 1 year ago

Anything is possible, it all depends on the needs of the business. I just want something more flexible and lightweight. I'm planning to use curl to make requests, as it's simpler that way

You could use curl to make requests, but you'll need a little more tools to accomplish the full txt2img processes. The commands below may help you.

Install the requirements

I assume you are using macOS.

brew install curl jq

Execute img2txt via cmd

One click solution

curl https://raw.githubusercontent.com/fiatrete/SDCN-Stable-Diffusion-Computing-Network/main/example/params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png

If you want to do some adjustments, you could download the template first.

curl -O https://raw.githubusercontent.com/fiatrete/SDCN-Stable-Diffusion-Computing-Network/main/example/params-txt2img.json

Another one click solution after modified the json

cat params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png

I think they are pretty simple. I have generated lots of images via cmd :)

Good job! Can I include your sample into the project's document?

troy6en commented 1 year ago

Good job! Can I include your sample into the project's document?

Sure you can~

I wanna more images :)

Ox2098 commented 1 year ago

Anything is possible, it all depends on the needs of the business. I just want something more flexible and lightweight. I'm planning to use curl to make requests, as it's simpler that way

You could use curl to make requests, but you'll need a little more tools to accomplish the full txt2img processes. The commands below may help you.

Install the requirements

I assume you are using macOS.

brew install curl jq

Execute img2txt via cmd

One click solution

curl https://raw.githubusercontent.com/fiatrete/SDCN-Stable-Diffusion-Computing-Network/main/example/params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png

If you want to do some adjustments, you could download the template first.

curl -O https://raw.githubusercontent.com/fiatrete/SDCN-Stable-Diffusion-Computing-Network/main/example/params-txt2img.json

Another one click solution after modified the json

cat params-txt2img.json \
| curl --location --request POST 'https://api.sdcn.info/txt2img' \
--header 'Content-Type: application/json' -d @- \
| jq '.images[0]' |tr -d '\"' | tr -d '\\' | base64 -d > out.png

I think they are pretty simple. I have generated lots of images via cmd :)

Good job! Can I include your sample into the project's document?

Nice!Much more esay than Python.