Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from langdetect import detect
|
|
10 |
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
11 |
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
12 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
13 |
-
|
14 |
models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL", "Vector Art XL", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "Disney", "CleanLinearMix"]
|
15 |
|
16 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
@@ -73,7 +73,7 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
73 |
"seed": seed if seed != -1 else random.randint(1, 1000000000)
|
74 |
}
|
75 |
|
76 |
-
image_bytes = requests.post(API_URL, headers=headers, json=payload).content
|
77 |
image = Image.open(io.BytesIO(image_bytes))
|
78 |
print(f'\033[1mГенерация {key} завершена!\033[0m ({prompt})')
|
79 |
return image
|
|
|
10 |
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
11 |
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
12 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
13 |
+
timeout = 100
|
14 |
models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL", "Vector Art XL", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "Disney", "CleanLinearMix"]
|
15 |
|
16 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
|
|
73 |
"seed": seed if seed != -1 else random.randint(1, 1000000000)
|
74 |
}
|
75 |
|
76 |
+
image_bytes = requests.post(API_URL, headers=headers, json=payload, timeout=timeout).content
|
77 |
image = Image.open(io.BytesIO(image_bytes))
|
78 |
print(f'\033[1mГенерация {key} завершена!\033[0m ({prompt})')
|
79 |
return image
|