-2

I'm trying to use the Automatic1111 Stable Diffusion API to make a new StableDiffusion web UI using Svelte.

The API calls just don't seem to work, even when I'm trying it through the official documentation at http://127.0.0.1:7860/docs#/default/text2imgapi_sdapi_v1_txt2img_post.

I always get the following error in the console:

API error: POST: http://127.0.0.1:7860/sdapi/v1/txt2img {'error': 'HTTPException', 'detail': "Script 'string' not found", 'body': '', 'errors': ''}.

In the Browser I installed an extension to bypass CORS.

(I'm running Automatic1111 in API mode using: ./webui.sh --api --cors-allow-origins CORS_ALLOW_ORIGINS)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Automatic1111 is a GitHub username. See https://github.com/AUTOMATIC1111 and [Why AUTOMATIC1111 is named like this?](https://genai.stackexchange.com/q/179/12) – Wicket Aug 13 '23 at 00:10

1 Answers1

0

It seems as though the payload you are sending in your request has some invalid property values set by default.

In your payload, change any properties that have the value of "string" to the value of: null.

example:

"scripts": "string"

to

"scripts": null

Otherwise, I believe you can also just remove that line all together.

example:

"prompt": "flying potato", 
"scripts": "string",
"otherWhateverProp": "breakfast"

would become:

"prompt": "flying potato", 
"otherWhateverProp": "breakfast"
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 12 '23 at 18:56