Update app.py
Browse files
app.py
CHANGED
|
@@ -189,15 +189,14 @@ def get_huggingface_safetensors(link):
|
|
| 189 |
raise Exception("Not a FLUX LoRA!")
|
| 190 |
|
| 191 |
# Extract image and trigger word
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
raise gr.Error(e)
|
| 201 |
|
| 202 |
# Initialize Hugging Face file system
|
| 203 |
fs = HfFileSystem()
|
|
|
|
| 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)
|
| 194 |
+
print(f"Image path {image_path}")
|
| 195 |
+
trigger_word = model_card.data.get("instance_prompt", "")
|
| 196 |
+
print(f"Image path {trigger_word}")
|
| 197 |
+
image_url = f"https://huggingface.co/{link}/resolve/main/{image_path}" if image_path else None
|
| 198 |
+
print(f"Image URL {image_url}")
|
| 199 |
+
|
|
|
|
| 200 |
|
| 201 |
# Initialize Hugging Face file system
|
| 202 |
fs = HfFileSystem()
|