mudando layot
Browse files
app.py
CHANGED
@@ -70,8 +70,7 @@ def retrieve_timesteps(
|
|
70 |
**kwargs,
|
71 |
):
|
72 |
if timesteps is not None and sigmas is not None:
|
73 |
-
raise ValueError("
|
74 |
-
if timesteps is not None:
|
75 |
scheduler.set_timesteps(timesteps=timesteps, device=device, **kwargs)
|
76 |
timesteps = scheduler.timesteps
|
77 |
num_inference_steps = len(timesteps)
|
@@ -454,7 +453,7 @@ def add_custom_lora(custom_lora):
|
|
454 |
if(custom_lora):
|
455 |
try:
|
456 |
title, repo, path, trigger_word, image = check_custom_model(custom_lora)
|
457 |
-
print(f"
|
458 |
card = f'''
|
459 |
<div class="custom_lora_card">
|
460 |
<span>Loaded custom LoRA:</span>
|
@@ -462,7 +461,7 @@ def add_custom_lora(custom_lora):
|
|
462 |
<img src="{image}" />
|
463 |
<div>
|
464 |
<h3>{title}</h3>
|
465 |
-
<small>{"
|
466 |
</div>
|
467 |
</div>
|
468 |
</div>
|
@@ -482,8 +481,8 @@ def add_custom_lora(custom_lora):
|
|
482 |
|
483 |
return gr.update(visible=True, value=card), gr.update(visible=True), gr.Gallery(selected_index=None), f"Custom: {path}", existing_item_index, trigger_word
|
484 |
except Exception as e:
|
485 |
-
gr.Warning(f"
|
486 |
-
return gr.update(visible=True, value=f"
|
487 |
else:
|
488 |
return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
|
489 |
|
@@ -599,9 +598,9 @@ a:hover {
|
|
599 |
}
|
600 |
'''
|
601 |
|
602 |
-
with gr.Blocks(
|
603 |
title = gr.HTML(
|
604 |
-
"""<
|
605 |
elem_id="title",
|
606 |
)
|
607 |
selected_index = gr.State(None)
|
|
|
70 |
**kwargs,
|
71 |
):
|
72 |
if timesteps is not None and sigmas is not None:
|
73 |
+
raise ValueError("Apenas um entre `timesteps` ou `sigmas` pode ser passado. Por favor, escolha um para definir valores personalizados")
|
|
|
74 |
scheduler.set_timesteps(timesteps=timesteps, device=device, **kwargs)
|
75 |
timesteps = scheduler.timesteps
|
76 |
num_inference_steps = len(timesteps)
|
|
|
453 |
if(custom_lora):
|
454 |
try:
|
455 |
title, repo, path, trigger_word, image = check_custom_model(custom_lora)
|
456 |
+
print(f"Modelo Externo: {repo}")
|
457 |
card = f'''
|
458 |
<div class="custom_lora_card">
|
459 |
<span>Loaded custom LoRA:</span>
|
|
|
461 |
<img src="{image}" />
|
462 |
<div>
|
463 |
<h3>{title}</h3>
|
464 |
+
<small>{"Usando: <code><b>"+trigger_word+"</code></b> como palavra-chave" if trigger_word else "Não encontramos a palavra-chave, se tiver, coloque-a no prompt."}<br></small>
|
465 |
</div>
|
466 |
</div>
|
467 |
</div>
|
|
|
481 |
|
482 |
return gr.update(visible=True, value=card), gr.update(visible=True), gr.Gallery(selected_index=None), f"Custom: {path}", existing_item_index, trigger_word
|
483 |
except Exception as e:
|
484 |
+
gr.Warning(f"Modelo Inválido: ou o link está errado ou não é um FLUX")
|
485 |
+
return gr.update(visible=True, value=f"Modelo Inválido: ou o link está errado ou não é um FLUX"), gr.update(visible=False), gr.update(), "", None, ""
|
486 |
else:
|
487 |
return gr.update(visible=False), gr.update(visible=False), gr.update(), "", None, ""
|
488 |
|
|
|
598 |
}
|
599 |
'''
|
600 |
|
601 |
+
with gr.Blocks(css=css, delete_cache=(60, 60)) as app:
|
602 |
title = gr.HTML(
|
603 |
+
"""<img src="https://collos.com.br/wp-content/uploads/2024/12/collos_p.png" alt="Logo" style="display: block; margin: 0 auto; padding: 5px 0px 20px 0px; width: 200px;" />""",
|
604 |
elem_id="title",
|
605 |
)
|
606 |
selected_index = gr.State(None)
|