Hermes Bot commited on
Commit
aad4bb7
·
1 Parent(s): e3704b8

Wrap LoRA controls in Column+Row to fix Accordion layout

Browse files
Files changed (1) hide show
  1. ui/shared/ui_components.py +14 -10
ui/shared/ui_components.py CHANGED
@@ -130,16 +130,20 @@ def create_lora_settings_ui(prefix: str):
130
  gr.Markdown("💡 **Tip:** When downloading from Civitai, please use the **Version ID**, not the Model ID. You can find the Version ID in the URL (e.g., `civitai.com/models/123?modelVersionId=456`) or under the model's download button. When downloading from Hugging Face, please use the format: `repo_id/filename.extension` or `repo_id/folder_path/filename.extension` (e.g., `lightx2v/Qwen-Image-Lightning/Qwen-Image-Lightning-4steps-V2.0-bf16.safetensors`).")
131
  components[f'lora_count_state_{prefix}'] = gr.State(1)
132
 
133
- for i in range(MAX_LORAS):
134
- source = gr.Dropdown(label=f"LoRA Source {i+1}", choices=LORA_SOURCE_CHOICES, value=LORA_SOURCE_CHOICES[0], scale=1)
135
- lora_id = gr.Textbox(label="Civitai Version ID / HF file / Upload File", scale=2, type="text")
136
- scale = gr.Slider(label=f"Scale", minimum=0.0, maximum=2.0, step=0.05, value=1.0, scale=1)
137
- upload = gr.UploadButton(label="Upload", file_types=[".safetensors"], scale=1)
138
-
139
- lora_sources.append(source)
140
- lora_ids.append(lora_id)
141
- lora_scales.append(scale)
142
- lora_uploads.append(upload)
 
 
 
 
143
 
144
  with gr.Row():
145
  components[f'add_lora_button_{prefix}'] = gr.Button("Add LoRA", variant="secondary")
 
130
  gr.Markdown("💡 **Tip:** When downloading from Civitai, please use the **Version ID**, not the Model ID. You can find the Version ID in the URL (e.g., `civitai.com/models/123?modelVersionId=456`) or under the model's download button. When downloading from Hugging Face, please use the format: `repo_id/filename.extension` or `repo_id/folder_path/filename.extension` (e.g., `lightx2v/Qwen-Image-Lightning/Qwen-Image-Lightning-4steps-V2.0-bf16.safetensors`).")
131
  components[f'lora_count_state_{prefix}'] = gr.State(1)
132
 
133
+ # Wrap LoRA controls in a column to ensure proper hierarchical parenting
134
+ with gr.Column() as lora_container:
135
+ for i in range(MAX_LORAS):
136
+ with gr.Row() as row:
137
+ source = gr.Dropdown(label=f"LoRA Source {i+1}", choices=LORA_SOURCE_CHOICES, value=LORA_SOURCE_CHOICES[0], scale=1)
138
+ lora_id = gr.Textbox(label="Civitai Version ID / HF file / Upload File", scale=2, type="text")
139
+ scale = gr.Slider(label=f"Scale", minimum=0.0, maximum=2.0, step=0.05, value=1.0, scale=1)
140
+ upload = gr.UploadButton(label="Upload", file_types=[".safetensors"], scale=1)
141
+
142
+ lora_rows.append(row)
143
+ lora_sources.append(source)
144
+ lora_ids.append(lora_id)
145
+ lora_scales.append(scale)
146
+ lora_uploads.append(upload)
147
 
148
  with gr.Row():
149
  components[f'add_lora_button_{prefix}'] = gr.Button("Add LoRA", variant="secondary")