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

Cache SD API verification #1553

Merged
merged 3 commits into from
Feb 12, 2023
Merged

Conversation

RunDevelopment
Copy link
Member

Verify that an SD API service is available is now done manually via the verify_api_connection. Nodes that wish to only appear when an SD API is up should call this function before registering. This also allows us to define SD nodes that should appear even if no external API is up.

The main motivation for this function are logs, though. The error message for when no API service is available is very detailed. This is good, but the message is also repeated 4 times, which makes it spam the log output.

> Attempting to spawn backend...
> Backend: [6868] [ERROR] A critical error occurred when importing module nodes.nodes.external_stable_diffusion.img2img: 
If you want to use external stable diffusion nodes, run the Automatic1111 web ui with the --api flag, like so:

./webui.sh --api

ChaiNNer is currently configured to look for the API at http://127.0.0.1:7860.  If you
have it running somewhere else, you can change this using the STABLE_DIFFUSION_HOST and STABLE_DIFFUSION_PORT
environment variables.

18:06:40.038 > Backend: [6868] [ERROR] A critical error occurred when importing module nodes.nodes.external_stable_diffusion.interrogate: 
If you want to use external stable diffusion nodes, run the Automatic1111 web ui with the --api flag, like so:

./webui.sh --api

ChaiNNer is currently configured to look for the API at http://127.0.0.1:7860.  If you
have it running somewhere else, you can change this using the STABLE_DIFFUSION_HOST and STABLE_DIFFUSION_PORT
environment variables.

18:06:42.055 > Backend: [6868] [ERROR] A critical error occurred when importing module nodes.nodes.external_stable_diffusion.outpainting: 
If you want to use external stable diffusion nodes, run the Automatic1111 web ui with the --api flag, like so:

./webui.sh --api

ChaiNNer is currently configured to look for the API at http://127.0.0.1:7860.  If you
have it running somewhere else, you can change this using the STABLE_DIFFUSION_HOST and STABLE_DIFFUSION_PORT
environment variables.

18:06:44.127 > Backend: [6868] [ERROR] A critical error occurred when importing module nodes.nodes.external_stable_diffusion.txt2img: 
If you want to use external stable diffusion nodes, run the Automatic1111 web ui with the --api flag, like so:

./webui.sh --api

ChaiNNer is currently configured to look for the API at http://127.0.0.1:7860.  If you
have it running somewhere else, you can change this using the STABLE_DIFFUSION_HOST and STABLE_DIFFUSION_PORT
environment variables.

The new function will only use an error with the detailed error message the first time around.

@adodge Thoughts?

@adodge
Copy link
Contributor

adodge commented Feb 12, 2023

Nice! A good idea, well implemented.

@joeyballentine joeyballentine merged commit 62db1bb into chaiNNer-org:main Feb 12, 2023
@RunDevelopment RunDevelopment deleted the sd-verify branch February 12, 2023 20:42
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

Successfully merging this pull request may close these issues.

3 participants