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

Error Message in Photopea When Attempting to Connect #23

Open
camoody1 opened this issue Aug 31, 2023 · 12 comments
Open

Error Message in Photopea When Attempting to Connect #23

camoody1 opened this issue Aug 31, 2023 · 12 comments

Comments

@camoody1
Copy link

"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
Copy link
Owner

huchenlei commented Aug 31, 2023

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

@camoody1
Copy link
Author

camoody1 commented Aug 31, 2023

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

@camoody1
Copy link
Author

camoody1 commented Aug 31, 2023

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
Copy link
Owner

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
Copy link
Author

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

@camoody1
Copy link
Author

camoody1 commented Sep 1, 2023

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
Copy link
Owner

huchenlei commented Sep 1, 2023

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

I cannot reproduce this issue locally though.

@johiny
Copy link

johiny commented Nov 19, 2023

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
Copy link
Owner

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
Copy link

johiny commented Nov 19, 2023

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
Copy link
Owner

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
Copy link

johiny commented Nov 21, 2023

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

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

No branches or pull requests

3 participants