Spaces:
Runtime error
Runtime error
Commit
·
1d0df7e
1
Parent(s):
17cda11
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,45 +6,21 @@ import os
|
|
| 6 |
from PIL import Image
|
| 7 |
|
| 8 |
list_models = [
|
| 9 |
-
"SD-1.4",
|
| 10 |
"SD-1.5",
|
| 11 |
-
"SD-2.1",
|
| 12 |
"SDXL-1.0",
|
| 13 |
"OpenJourney-V4",
|
| 14 |
-
"Midjourney-mini",
|
| 15 |
-
"Dreamshaper-XL-1.0",
|
| 16 |
-
"Protogen-x5.8",
|
| 17 |
-
"WavyFusion",
|
| 18 |
-
"OpenGen",
|
| 19 |
-
"Deliberate",
|
| 20 |
"Pixel-Art-XL",
|
| 21 |
]
|
| 22 |
|
| 23 |
def generate_txt2img(current_model, prompt, is_negative=False, image_style="None style", steps=50, cfg_scale=7,
|
| 24 |
seed=None):
|
| 25 |
|
| 26 |
-
if current_model == "SD-1.
|
| 27 |
-
API_URL = "https://api-inference.huggingface.co/models/CompVis/stable-diffusion-v1-4"
|
| 28 |
-
elif current_model == "SD-1.5":
|
| 29 |
API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
|
| 30 |
-
elif current_model == "SD-2.1":
|
| 31 |
-
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1"
|
| 32 |
elif current_model == "SDXL-1.0":
|
| 33 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
| 34 |
elif current_model == "OpenJourney-V4":
|
| 35 |
API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney"
|
| 36 |
-
elif current_model == "Midjourney-mini":
|
| 37 |
-
API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-mini"
|
| 38 |
-
elif current_model == "Dreamshaper-XL-1.0":
|
| 39 |
-
API_URL = "https://api-inference.huggingface.co/models/Lykon/dreamshaper-xl-1-0"
|
| 40 |
-
elif current_model == "Protogen-x5.8":
|
| 41 |
-
API_URL = "https://api-inference.huggingface.co/models/darkstorm2150/Protogen_x5.8_Official_Release"
|
| 42 |
-
elif current_model == "WavyFusion":
|
| 43 |
-
API_URL = "https://api-inference.huggingface.co/models/wavymulder/wavyfusion"
|
| 44 |
-
elif current_model == "OpenGen":
|
| 45 |
-
API_URL = "https://api-inference.huggingface.co/models/darkstorm2150/OpenGen"
|
| 46 |
-
elif current_model == "Deliberate":
|
| 47 |
-
API_URL = "https://api-inference.huggingface.co/models/Yntec/Deliberate"
|
| 48 |
elif current_model == "Pixel-Art-XL":
|
| 49 |
API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
|
| 50 |
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
|
| 8 |
list_models = [
|
|
|
|
| 9 |
"SD-1.5",
|
|
|
|
| 10 |
"SDXL-1.0",
|
| 11 |
"OpenJourney-V4",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
"Pixel-Art-XL",
|
| 13 |
]
|
| 14 |
|
| 15 |
def generate_txt2img(current_model, prompt, is_negative=False, image_style="None style", steps=50, cfg_scale=7,
|
| 16 |
seed=None):
|
| 17 |
|
| 18 |
+
if current_model == "SD-1.5":
|
|
|
|
|
|
|
| 19 |
API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
|
|
|
|
|
|
|
| 20 |
elif current_model == "SDXL-1.0":
|
| 21 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
| 22 |
elif current_model == "OpenJourney-V4":
|
| 23 |
API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
elif current_model == "Pixel-Art-XL":
|
| 25 |
API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
|
| 26 |
|