Spaces:
Sleeping
Sleeping
lichorosario
commited on
Commit
•
e8606c8
1
Parent(s):
54a6851
feat: Actualizar app.py para usar el cliente Tile-Upscaler nuevo
Browse files
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import json
|
4 |
-
|
5 |
-
from gradio_client import Client as CustomModelClient
|
6 |
-
# from gradio_client import Client as TileUpscalerClient
|
7 |
-
|
8 |
from gradio_imageslider import ImageSlider
|
9 |
|
10 |
with open('loras.json', 'r') as f:
|
@@ -12,10 +9,17 @@ with open('loras.json', 'r') as f:
|
|
12 |
|
13 |
job = None
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
client_custom_model = CustomModelClient("fffiloni/sd-xl-custom-model")
|
18 |
-
# client_tile_upscaler = TileUpscalerClient("gokaygokay/Tile-Upscaler")
|
19 |
|
20 |
|
21 |
def infer(selected_index, prompt, style_prompt, inf_steps, guidance_scale, width, height, seed, lora_weight, progress=gr.Progress(track_tqdm=True)):
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import json
|
4 |
+
from gradio_client import Client, handle_file
|
|
|
|
|
|
|
5 |
from gradio_imageslider import ImageSlider
|
6 |
|
7 |
with open('loras.json', 'r') as f:
|
|
|
9 |
|
10 |
job = None
|
11 |
|
12 |
+
# Verificar las URLs de los modelos
|
13 |
+
custom_model_url = "https://fffiloni-sd-xl-custom-model.hf.space"
|
14 |
+
tile_upscaler_url = "https://gokaygokay/Tile-Upscaler.hf.space"
|
15 |
+
try:
|
16 |
+
client_custom_model = Client(custom_model_url)
|
17 |
+
# client_custom_model = CustomModelClient(custom_model_url)
|
18 |
+
print(f"Loaded custom model from {custom_model_url}")
|
19 |
+
except ValueError as e:
|
20 |
+
print(f"Failed to load custom model: {e}")
|
21 |
|
22 |
+
# other_client = Client("gokaygokay/Tile-Upscaler")
|
|
|
|
|
23 |
|
24 |
|
25 |
def infer(selected_index, prompt, style_prompt, inf_steps, guidance_scale, width, height, seed, lora_weight, progress=gr.Progress(track_tqdm=True)):
|