huchenlei / stable-diffusion-ps-pea

Use Stable Diffusion in Photopea!
GNU General Public License v3.0
74 stars 3 forks source link

Error Message in Photopea When Attempting to Connect #23

Open camoody1 opened 1 year ago

camoody1 commented 1 year ago

"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.

huchenlei commented 1 year ago

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

camoody1 commented 1 year ago

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

camoody1 commented 1 year ago

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.

huchenlei commented 1 year ago

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...]
camoody1 commented 1 year ago

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

camoody1 commented 1 year ago

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

huchenlei commented 1 year ago

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.

johiny commented 9 months ago

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

huchenlei commented 9 months ago

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?

johiny commented 9 months ago

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

huchenlei commented 9 months ago

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

johiny commented 9 months ago

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