stable-diffusion-ps-pea icon indicating copy to clipboard operation
stable-diffusion-ps-pea copied to clipboard

Error Message in Photopea When Attempting to Connect

Open camoody1 opened this issue 2 years ago • 12 comments

"Connection Failed: TypeError: Failed to fetch"

I have Automatic1111 open with a live connection. I am able to create images in that application. However, when I try to connect in Photopea, I get that error message. Any suggestions to help resolve this?

I'm running the new Automatic1111 RC 1.6.0 if that makes a difference.

camoody1 avatar Aug 31 '23 01:08 camoody1

Browser console output? I recently added support for tagger, but that logic should be optional.

huchenlei avatar Aug 31 '23 01:08 huchenlei

I hope this is what you're asking for... image

camoody1 avatar Aug 31 '23 02:08 camoody1

Could it have something to do with me using the RC version of Automatic1111? I have both the current release AND the release candidate version of A1111 installed on my machine. But I'm only running the RC version, right now.

Also, I have all of my models saved in a separate folder structure outside of the sdwebui folders since I also use ComfyUI and like having all of my downloaded files in one location.

camoody1 avatar Aug 31 '23 02:08 camoody1

Do you still have the flag on? The console log indicates that you are probably missing the cors flag.

set COMMANDLINE_ARGS=--api --cors-allow-origins https://huchenlei.github.io [Rest of ARGS...]

huchenlei avatar Aug 31 '23 03:08 huchenlei

Yes. I still have that enabled in my webuser.bat file.

camoody1 avatar Aug 31 '23 05:08 camoody1

Any ideas? I'm using the release version of Automatic1111, again, and it's still not working. This is my webuser.bat file:

@echo off

set PYTHON= set GIT= set VENV_DIR= set COMMANDLINE_ARGS=--xformers --autolaunch --update-check --medvram --api --cors-allow-origins https://huchenlei.github.io ^ --ckpt-dir "H:\Stable_Diffusion_Models\models\stable-diffusion" ^ --vae-dir "H:\Stable_Diffusion_Models\models\VAE" ^ --gfpgan-dir "H:\Stable_Diffusion_Models\models\GFPGAN" ^ --esrgan-models-path "H:\Stable_Diffusion_Models\models\ESRGAN" ^ --bsrgan-models-path "H:\Stable_Diffusion_Models\models\BSRGAN" ^ --realesrgan-models-path "H:\Stable_Diffusion_Models\models\RealESRGAN" ^ --swinir-models-path "H:\Stable_Diffusion_Models\models\SwinIR" ^ --ldsr-models-path "H:\Stable_Diffusion_Models\models\LDSR" ^ --lora-dir "H:\Stable_Diffusion_Models\models\Lora" ^ --embeddings-dir "H:\Stable_Diffusion_Models\models\Embeddings" ^ --codeformer-models-path "H:\Stable_Diffusion_Models\models\Codeformer" ^ --controlnet-dir "H:\Stable_Diffusion_Models\models\ControlNet" git pull call webui.bat

camoody1 avatar Sep 01 '23 07:09 camoody1

I think it’s a1111’s issue. Other extensions using the api are also having problems. See https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin/issues/361 . You can fall back to v1.5.2 for now while a1111 solving the issue.

I cannot reproduce this issue locally though.

huchenlei avatar Sep 01 '23 14:09 huchenlei

hello have you tested it on Linux? i test it with 1.6 and 1.5.2 but no one connects, do you know if i have to make something extra? note: amazing work it gives so much power to photopea

johiny avatar Nov 19 '23 19:11 johiny

I think the only thing you need to do is adding necessary commandline args when launching A1111.

--api --cors-allow-origins https://huchenlei.github.io

Do you have success with Windows but fail on Linux? Is the Linux a localhost or remote?

huchenlei avatar Nov 19 '23 19:11 huchenlei

yes it was working perfect on windows with the directml version, i use this custom script for rocm to work

#!/bin/sh source venv/bin/activate export HSA_OVERRIDE_GFX_VERSION=10.3.0 export HIP_VISIBLE_DEVICES=0 export PYTORCH_HIP_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512

python3 launch.py --api --cors-allow-origins https://huchenlei.github.io --enable-insecure-extension-access --opt-sdp-attention --no-half-vae --medvram

I'm running everything on local

johiny avatar Nov 19 '23 20:11 johiny

Sorry I do not have a Linux machine to reproduce this issue, but you can verify that whether the cors-allow-origins is correctly configured by adding a print call here:

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/4afaaf8a020c1df457bcf7250cb1c7f609699fa7/modules/initialize_util.py#L197-L201

huchenlei avatar Nov 19 '23 21:11 huchenlei

hello thx for the help i was testing and cors looks ok, but it still doesn't work very weird maybe some Linux behavior?, at the end i go with the public link option for a workaround. New Project

johiny avatar Nov 21 '23 17:11 johiny