KoushikNavuluri / stable-diffusion-xl-api

Reverse engineered API of Stable Diffusion XL 1.0 ( Midjourney Alternative ), A text-to-image generative AI model that creates beautiful 1024x1024 images.
https://pypi.org/project/sdxl/
MIT License
40 stars 1 forks source link

Error #4

Closed PushkarOP closed 1 year ago

PushkarOP commented 1 year ago

Error occurred while making the request: 403 Client Error: Forbidden for url: https://replicate.com/api/models/stability-ai/sdxl/versions/2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2/predictions

PushkarOP commented 1 year ago

Error occurred while making the request: 403 Client Error: Forbidden for url: https://replicate.com/api/models/stability-ai/sdxl/versions/2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2/predictions Traceback (most recent call last): File "/home/container/app.py", line 10, in print(get_chatbot_response(user_input, "sdxl")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/container/chatbot_api.py", line 254, in get_chatbot_response response = sdxl(prompt) ^^^^^^^^^^^^ File "/home/container/chatbot_api.py", line 124, in sdxl url = images["images"][0]


TypeError: 'NoneType' object is not subscriptable
KoushikNavuluri commented 1 year ago

can you show me your code snapshot?

PushkarOP commented 1 year ago

def sdxl(prompt): images = img_client.gen_image(prompt=prompt,count=1, width=1024, height=1024, refine="expert_ensemble_refiner", scheduler="DDIM", guidance_scale=7.5, high_noise_frac=0.8, prompt_strength=0.8, num_inference_steps=50)

url = images["images"][0] (Line 124)

print("⊢ Image Generated (" + prompt + ")")
return git_upload(prompt, url)

def get_chatbot_response(prompt, chat_model=None, model=None, resize=False, size=None): if chat_model == "bard": response = bard_res(prompt) elif chat_model == "chatgpt": response = chatgpt(prompt, model) elif chat_model == "chimera_img": response = chimera_img(prompt) elif chat_model == "papaya": response = papaya_gpt(prompt, model) elif chat_model == "ylokh": response = ylokh(prompt, model) elif chat_model == "sdxl":

response = sdxl(prompt) (Line 254)

else:
    return "No chat model selected"
return response
PushkarOP commented 1 year ago

Code: """ from sdxl import ImageGenerator client = ImageGenerator() images = client.gen_image( "Vibrant, Headshot of a serene, meditating individual surrounded by soft, ambient lighting.") print(images) """

Output: Error occurred while making the request: 403 Client Error: Forbidden for url: https://replicate.com/api/models/stability-ai/sdxl/versions/2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2/predictions None

PushkarOP commented 1 year ago

Add proxy support, maybe it can fix it