Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ox2098 opened this issue Mar 14, 2023 · 6 comments
Open

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

Ox2098 opened this issue Mar 14, 2023 · 6 comments

Comments

@Ox2098
Copy link

Ox2098 commented Mar 14, 2023

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
Copy link
Owner

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

@Ox2098
Copy link
Author

Ox2098 commented Mar 14, 2023

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
Copy link
Contributor

troy6en commented Mar 15, 2023

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
Copy link
Owner

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
Copy link
Contributor

troy6en commented Mar 15, 2023

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

Sure you can~

I wanna more images :)

@Ox2098
Copy link
Author

Ox2098 commented Mar 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants