Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -185,9 +185,13 @@ def get_huggingface_safetensors(link):
|
|
| 185 |
print(f"Base model: {base_model}")
|
| 186 |
|
| 187 |
# Validate model type
|
| 188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
raise Exception("Not a FLUX LoRA!")
|
| 190 |
-
|
| 191 |
# Extract image and trigger word
|
| 192 |
print("Before trying to get image")
|
| 193 |
image_path = model_card.data.get("widget", [{}])[0].get("output", {}).get("url", None)
|
|
|
|
| 185 |
print(f"Base model: {base_model}")
|
| 186 |
|
| 187 |
# Validate model type
|
| 188 |
+
acceptable_models = {"black-forest-labs/FLUX.1-dev", "black-forest-labs/FLUX.1-schnell"}
|
| 189 |
+
|
| 190 |
+
models_to_check = base_model if isinstance(base_model, list) else [base_model]
|
| 191 |
+
|
| 192 |
+
if not any(model in acceptable_models for model in models_to_check):
|
| 193 |
raise Exception("Not a FLUX LoRA!")
|
| 194 |
+
|
| 195 |
# Extract image and trigger word
|
| 196 |
print("Before trying to get image")
|
| 197 |
image_path = model_card.data.get("widget", [{}])[0].get("output", {}).get("url", None)
|