Spaces:
Runtime error
Runtime error
Commit
·
c7811fb
1
Parent(s):
ee14ad3
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,8 @@ from PIL import Image
|
|
| 8 |
# List of available models
|
| 9 |
list_models = [
|
| 10 |
"SDXL-1.0", "SD-1.5", "OpenJourney-V4", "Anything-V4",
|
| 11 |
-
"Disney-Pixar-Cartoon", "Pixel-Art-XL", "Dalle-3-XL",
|
|
|
|
| 12 |
]
|
| 13 |
|
| 14 |
# Function to generate images from text
|
|
@@ -29,7 +30,9 @@ def generate_txt2img(current_model, prompt, is_negative=False, image_style="None
|
|
| 29 |
elif current_model == "Dalle-3-XL":
|
| 30 |
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
| 31 |
elif current_model == "Midjourney-V4-XL":
|
| 32 |
-
API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-v4-xl"
|
|
|
|
|
|
|
| 33 |
|
| 34 |
API_TOKEN = os.environ.get("HF_READ_TOKEN")
|
| 35 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
|
|
| 8 |
# List of available models
|
| 9 |
list_models = [
|
| 10 |
"SDXL-1.0", "SD-1.5", "OpenJourney-V4", "Anything-V4",
|
| 11 |
+
"Disney-Pixar-Cartoon", "Pixel-Art-XL", "Dalle-3-XL",
|
| 12 |
+
"Midjourney-V4-XL", "Playground-v2-1024px-aesthetic",
|
| 13 |
]
|
| 14 |
|
| 15 |
# Function to generate images from text
|
|
|
|
| 30 |
elif current_model == "Dalle-3-XL":
|
| 31 |
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
| 32 |
elif current_model == "Midjourney-V4-XL":
|
| 33 |
+
API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-v4-xl"
|
| 34 |
+
elif current_model == "Playground-v2-1024px-aesthetic":
|
| 35 |
+
API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
|
| 36 |
|
| 37 |
API_TOKEN = os.environ.get("HF_READ_TOKEN")
|
| 38 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|