Spaces:
Sleeping
Sleeping
Commit
·
7134d92
1
Parent(s):
7b9ab38
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,13 +6,14 @@ import os
|
|
| 6 |
from PIL import Image
|
| 7 |
|
| 8 |
list_models = [
|
| 9 |
-
"SD-1.5",
|
| 10 |
"SDXL-1.0",
|
|
|
|
| 11 |
"OpenJourney-V4",
|
| 12 |
"Anything-V4",
|
| 13 |
"Disney-Pixar-Cartoon",
|
| 14 |
"Pixel-Art-XL",
|
| 15 |
"Dalle-3-XL",
|
|
|
|
| 16 |
]
|
| 17 |
|
| 18 |
def generate_txt2img(current_model, prompt, is_negative=False, image_style="None style", steps=50, cfg_scale=7,
|
|
@@ -23,7 +24,7 @@ def generate_txt2img(current_model, prompt, is_negative=False, image_style="None
|
|
| 23 |
elif current_model == "SDXL-1.0":
|
| 24 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
| 25 |
elif current_model == "OpenJourney-V4":
|
| 26 |
-
API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney"
|
| 27 |
elif current_model == "Anything-V4":
|
| 28 |
API_URL = "https://api-inference.huggingface.co/models/xyn-ai/anything-v4.0"
|
| 29 |
elif current_model == "Disney-Pixar-Cartoon":
|
|
@@ -31,8 +32,9 @@ def generate_txt2img(current_model, prompt, is_negative=False, image_style="None
|
|
| 31 |
elif current_model == "Pixel-Art-XL":
|
| 32 |
API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
|
| 33 |
elif current_model == "Dalle-3-XL":
|
| 34 |
-
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
API_TOKEN = os.environ.get("HF_READ_TOKEN")
|
| 38 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
|
| 8 |
list_models = [
|
|
|
|
| 9 |
"SDXL-1.0",
|
| 10 |
+
"SD-1.5",
|
| 11 |
"OpenJourney-V4",
|
| 12 |
"Anything-V4",
|
| 13 |
"Disney-Pixar-Cartoon",
|
| 14 |
"Pixel-Art-XL",
|
| 15 |
"Dalle-3-XL",
|
| 16 |
+
"Midjourney-V4-XL",
|
| 17 |
]
|
| 18 |
|
| 19 |
def generate_txt2img(current_model, prompt, is_negative=False, image_style="None style", steps=50, cfg_scale=7,
|
|
|
|
| 24 |
elif current_model == "SDXL-1.0":
|
| 25 |
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
| 26 |
elif current_model == "OpenJourney-V4":
|
| 27 |
+
API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney"
|
| 28 |
elif current_model == "Anything-V4":
|
| 29 |
API_URL = "https://api-inference.huggingface.co/models/xyn-ai/anything-v4.0"
|
| 30 |
elif current_model == "Disney-Pixar-Cartoon":
|
|
|
|
| 32 |
elif current_model == "Pixel-Art-XL":
|
| 33 |
API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
|
| 34 |
elif current_model == "Dalle-3-XL":
|
| 35 |
+
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
| 36 |
+
elif current_model == "Midjourney-V4-XL":
|
| 37 |
+
API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-v4-xl"
|
| 38 |
|
| 39 |
API_TOKEN = os.environ.get("HF_READ_TOKEN")
|
| 40 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|