Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,12 +45,12 @@ with open("sdxl_loras.json", "r") as file:
|
|
| 45 |
data = json.load(file)
|
| 46 |
sdxl_loras_raw = [
|
| 47 |
{
|
| 48 |
-
"image": item
|
| 49 |
-
"title": item
|
| 50 |
-
"repo": item
|
| 51 |
-
"trigger_word": item
|
| 52 |
-
"weights": item
|
| 53 |
-
"is_compatible": item
|
| 54 |
"is_pivotal": item.get("is_pivotal", False),
|
| 55 |
"text_embedding_weights": item.get("text_embedding_weights", None),
|
| 56 |
"likes": item.get("likes", 0),
|
|
@@ -171,7 +171,7 @@ def update_selection(selected_state: gr.SelectData, sdxl_loras, face_strength, i
|
|
| 171 |
lora_repo = sdxl_loras[selected_state.index]["repo"]
|
| 172 |
new_placeholder = "Type a prompt to use your selected LoRA"
|
| 173 |
weight_name = sdxl_loras[selected_state.index]["weights"]
|
| 174 |
-
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo})
|
| 175 |
|
| 176 |
for lora_list in lora_defaults:
|
| 177 |
if lora_list["model"] == sdxl_loras[selected_state.index]["repo"]:
|
|
@@ -502,7 +502,7 @@ with gr.Blocks(css="custom.css") as demo:
|
|
| 502 |
display: block;
|
| 503 |
font-weight: normal;
|
| 504 |
opacity: 0.75;
|
| 505 |
-
"
|
| 506 |
elem_id="title",
|
| 507 |
)
|
| 508 |
selected_state = gr.State()
|
|
|
|
| 45 |
data = json.load(file)
|
| 46 |
sdxl_loras_raw = [
|
| 47 |
{
|
| 48 |
+
"image": item.get("image", ""),
|
| 49 |
+
"title": item.get("nickname", item.get("title", "")),
|
| 50 |
+
"repo": item.get("model", item.get("repo", "")),
|
| 51 |
+
"trigger_word": item.get("prompt", item.get("trigger_word", "")),
|
| 52 |
+
"weights": item.get("weights", ""),
|
| 53 |
+
"is_compatible": item.get("is_compatible", True),
|
| 54 |
"is_pivotal": item.get("is_pivotal", False),
|
| 55 |
"text_embedding_weights": item.get("text_embedding_weights", None),
|
| 56 |
"likes": item.get("likes", 0),
|
|
|
|
| 171 |
lora_repo = sdxl_loras[selected_state.index]["repo"]
|
| 172 |
new_placeholder = "Type a prompt to use your selected LoRA"
|
| 173 |
weight_name = sdxl_loras[selected_state.index]["weights"]
|
| 174 |
+
updated_text = f"### Selected: [{lora_repo}](https://huggingface.co/{lora_repo}) ✨ {'(non-commercial LoRA, `cc-by-nc`)' if sdxl_loras[selected_state.index]['is_nc'] else '' }"
|
| 175 |
|
| 176 |
for lora_list in lora_defaults:
|
| 177 |
if lora_list["model"] == sdxl_loras[selected_state.index]["repo"]:
|
|
|
|
| 502 |
display: block;
|
| 503 |
font-weight: normal;
|
| 504 |
opacity: 0.75;
|
| 505 |
+
">🧨 diffusers InstantID + ControlNet<br> inspired by fofr's <a href="https://github.com/fofr/cog-face-to-many" target="_blank">face-to-many</a></small></span></h1>""",
|
| 506 |
elem_id="title",
|
| 507 |
)
|
| 508 |
selected_state = gr.State()
|