-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Stable Diffusion via REST #1500
Conversation
- Exposes a run_async() coroutine - processed appropriately in process.py
- globals for interacting with the automatic1111 API - encoding/decoding images from the JSON - async HTTP call to the API
- Nodes interacting with the automatic1111 API - text2img, img2img, and interrogate
This is really cool! Thanks! I'm not too sure how i feel about relying on a separate server to run this stuff though. It makes sense in that it's a lot easier to not have to integrate everything directly, but i feel like it has the potential to cause lots of issues and incompatibility given enough time. For example if automatic's SD repo updates and makes breaking changes, people would need to use an old version for this to work properly. This would however be the perfect use case for a plugin once we have the plugin system implemented, but I'll defer to @RunDevelopment on this one to see what he thinks. |
Skimmed through the code. I like that you put this in a separate REST category to make it clear that it's interacting with external things and not anything built into chaiNNer. If you don't have SD running, do these nodes still show up? What happens in that case? |
Thanks for taking a look! Yes, all good points. The nodes do show up, but obviously they report an error if you try to run them. I could have it try to connect to the API when the nodes are imported. |
We're currently talking about this, and we feel the benefits of adding this most likely outweigh any drawbacks. Are you in our Discord server? I think it would be easier to discuss this with you there, if you don't mind |
- causes the nodes to be hidden if the API isn't up - also these options might be useful later
d1c3a45
to
c5f1a4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @adodge! Great work!
I left you a few comments with questions and suggestions.
fa3b6be
to
c999e2e
Compare
- renaming REST to External Stable Diffusion - making some text arguments optional - using sliders where appropriate - using the "seed" group - geting rid of async - we're already calling the nodes in a thread, so we don't need individual http calls to be async - replace aiohttp with requests in requirements
c999e2e
to
4f5fae3
Compare
The results of this all still get saved by automatic's repo right? Like there's no chance someone would generate something cool but forget to save it and never be able to get it back? I'll try this out myself when I have some time |
Weirdly it doesn't save, and I don't see an option in the API to do so. Would be good to have an easy way to do something similar on the ChaiNNer side. Maybe a node that outputs the current time as text, that could be used with the save node. There's also the problem of saving metadata. The API does give a JSON blob with metadata, so that could be an output from the SD node, and we could hook it into a "Save Text" node. |
- Added requests library to requirements.ts - Removed kebab case in favor of "Text to Image" - Changed LargeImageOutput to ImageOutput
Made a few more changes in response to feedback:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay!
One last thing for the Img2Img and Tex2Img nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about this. Last last last change request.
- Actually looks like SD rounds down to the nearest multiple of 8 - Added slider_step and control_step to SliderInputs - Added a runtime error if an invalid value is manually entered or piped in - Would be nice if we could encode this "round down" behavior in the image_type expression of the output type, then we could get rid of the runtime error
Whoops. Fix that conflict and I'll merge this |
@joeyballentine Oops. Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Thanks again for this
Hi! Thanks for this project. It's exactly the sort of thing I was looking for. I made some nodes to hook into Automatic1111.
To get it running, you have to set up the service from here: https://github.com/AUTOMATIC1111/stable-diffusion-webui and run it with
./webui.sh --api
to expose the REST API. Here are some examples of it working: