Spaces:
Running
Running
Chandima Prabhath
commited on
Commit
·
0d9d5af
1
Parent(s):
3b40669
Increase backoff duration for image fetching and limit returned prompt to first paragraph
Browse files
FLUX.py
CHANGED
@@ -85,7 +85,7 @@ def generate_image(
|
|
85 |
)
|
86 |
logger.debug(f"Fetching image (seed={seed}): {url}")
|
87 |
|
88 |
-
backoff = 1
|
89 |
for attempt in range(1, MAX_RETRIES + 1):
|
90 |
try:
|
91 |
resp = requests.get(url, timeout=45)
|
@@ -140,4 +140,4 @@ def generate_image(
|
|
140 |
|
141 |
# upload
|
142 |
image_url = upload_to_imgbb(path, filename) or ""
|
143 |
-
return image, path, returned_prompt, image_url
|
|
|
85 |
)
|
86 |
logger.debug(f"Fetching image (seed={seed}): {url}")
|
87 |
|
88 |
+
backoff = 1000 # equivalent to 1 second
|
89 |
for attempt in range(1, MAX_RETRIES + 1):
|
90 |
try:
|
91 |
resp = requests.get(url, timeout=45)
|
|
|
140 |
|
141 |
# upload
|
142 |
image_url = upload_to_imgbb(path, filename) or ""
|
143 |
+
return image, path, returned_prompt.split("\n\n", 1)[0], image_url
|