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

Unable to call API payload containing alwayson_scripts #2517

Open
bobiblazeski opened this issue Dec 29, 2024 · 2 comments
Open

Unable to call API payload containing alwayson_scripts #2517

bobiblazeski opened this issue Dec 29, 2024 · 2 comments

Comments

@bobiblazeski
Copy link

I'm trying to call forge API with JSON that I've copied from API payload extension,
if I delete the alwayson_scripts key everything works fine, with it I'm getting the error:

list assignment index out of range

import requests
import json
import io
import base64

from PIL import Image

with open('payload.json', 'r') as file:
    payload = json.load(file)

response = requests.post(url=f'http://127.0.0.1:7860/sdapi/v1/txt2img', json=payload)
print(response)
# <Response [500]>
print(response.json())
# {'error': 'IndexError', 'detail': '', 'body': '', 'message': 'list assignment index out of range'}

del payload['alwayson_scripts']
response = requests.post(url=f'http://127.0.0.1:7860/sdapi/v1/txt2img', json=payload)
print(response)
r = response.json()
for i in r['images']:
    image = Image.open(io.BytesIO(base64.b64decode(i.split(",",1)[0])))
image  
![00014-3806821438](https://github.com/user-attachments/assets/f7818f14-7ef4-43d6-87bd-3348e0e5493b)

I tried several other examples but they all seem to have the same problems , I would like to call via API:
sd1.5 realisticVisionV60B1_v51HyperVAE.safetensors,
ControlNet control_v11p_sd15_openpose [cab727d4],
ControlNet ip-adapter-faceid-plusv2_sd15 [6e14fc1a]

My system is Ubuntu 24.10, RTX 2070

payload.json
terminal_error.txt
Line when error happens https://github.com/lllyasviel/stable-diffusion-webui-forge/blob/main/modules/api/api.py#L362

@vgrashal16
Copy link

damn, even I am facing the similar issue, did you find any solution to this problem?

@bobiblazeski
Copy link
Author

I'm afraid not, will have to look later after the New Year

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

2 participants