You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When using the web UI via Colab, there's a 60-second timeout for POST requests. This causes failures when generating SDXL images or upscaling via API, even though the same operations work fine through the local web UI in Colab.
Steps to Reproduce:
Run the web UI in Colab
Attempt to generate SDXL or upscaled images via API with the following code:
try:
response = requests.post(url=f'{url}/sdapi/v1/txt2img', json=payload, timeout=600)
response.raise_for_status()
r = response.json()
with open("output.png", 'wb') as f:
f.write(base64.b64decode(r['images'][0]))
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
except KeyError:
print("Response format unexpected")
except Exception as e:
print(f"Unexpected error: {e}")
Expected Behavior:
API should complete image generation for SDXL/upscaling tasks that take longer than 60 seconds
Should return the generated image in the response
Actual Behavior:
Request times out after 60 seconds
Results in a KeyError for 'images' as no image data is returned
Additional Context:
The same image generation works fine through the web UI in Colab
The issue only occurs with longer-running tasks (SDXL, upscaling)
The timeout appears to be a hard limit on the Gradio side
Suggested Solution:
Either:
Increase the default timeout for API requests, or
Make the timeout configurable when launching the web UI
Error Log:
KeyError Traceback (most recent call last)
Cell In[24], line 29
27 # Decode and save the image.
28 with open("output.png", 'wb') as f:
---> 29 f.write(base64.b64decode(r['images'][0]))
31 r
Description:
When using the web UI via Colab, there's a 60-second timeout for POST requests. This causes failures when generating SDXL images or upscaling via API, even though the same operations work fine through the local web UI in Colab.
Steps to Reproduce:
Run the web UI in Colab
Attempt to generate SDXL or upscaled images via API with the following code:
python
import requests
import base64
url = "https://....gradio.live/"
payload = {
"prompt": "puppy dog",
"steps": 400,
}
try:
response = requests.post(url=f'{url}/sdapi/v1/txt2img', json=payload, timeout=600)
response.raise_for_status()
r = response.json()
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
except KeyError:
print("Response format unexpected")
except Exception as e:
print(f"Unexpected error: {e}")
Expected Behavior:
API should complete image generation for SDXL/upscaling tasks that take longer than 60 seconds
Should return the generated image in the response
Actual Behavior:
Request times out after 60 seconds
Results in a KeyError for 'images' as no image data is returned
Additional Context:
The same image generation works fine through the web UI in Colab
The issue only occurs with longer-running tasks (SDXL, upscaling)
The timeout appears to be a hard limit on the Gradio side
Suggested Solution:
Either:
Increase the default timeout for API requests, or
Make the timeout configurable when launching the web UI
Error Log:
KeyError Traceback (most recent call last)
Cell In[24], line 29
27 # Decode and save the image.
28 with open("output.png", 'wb') as f:
---> 29 f.write(base64.b64decode(r['images'][0]))
31 r
KeyError: 'images'
Environment:
Platform: Google Colab
WebUI version: 71575ff
Model: SDXL/upscaling models
Tried already:
gradio que,
increasing timeout in post
timeout for requests library in python
localtunnel
cloudflare
The text was updated successfully, but these errors were encountered: