Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -156,46 +156,30 @@ with gr.Blocks(css=css) as demo:
|
|
156 |
)
|
157 |
|
158 |
# PART 1 • MODELS
|
159 |
-
|
|
|
|
|
|
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
your_username = api.whoami()["name"]
|
166 |
-
my_models = api.list_models(author=your_username, filter=["diffusers", "stable-diffusion-xl", 'lora'])
|
167 |
-
model_names = [item.modelId for item in my_models]
|
168 |
-
|
169 |
-
#print(model_names)
|
170 |
-
|
171 |
|
|
|
|
|
172 |
lora_1_id = gr.Dropdown(
|
173 |
label = "LoRa 1 ID",
|
174 |
choices = model_names,
|
175 |
allow_custom_value = True
|
176 |
#placeholder = "username/model_id"
|
177 |
)
|
178 |
-
|
179 |
-
else:
|
180 |
-
lora_1_id = gr.Textbox(
|
181 |
-
label = "LoRa 1 ID",
|
182 |
-
placeholder = "username/model_id"
|
183 |
-
)
|
184 |
-
|
185 |
-
lora_1_sfts = gr.Dropdown(
|
186 |
-
label = "Safetensors file",
|
187 |
-
visible=False
|
188 |
-
)
|
189 |
-
|
190 |
-
with gr.Column():
|
191 |
-
|
192 |
-
if not is_shared_ui:
|
193 |
-
|
194 |
-
your_username = api.whoami()["name"]
|
195 |
-
my_models = api.list_models(author=your_username, filter=["diffusers", "stable-diffusion-xl", 'lora'])
|
196 |
-
model_names = [item.modelId for item in my_models]
|
197 |
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
lora_2_id = gr.Dropdown(
|
201 |
label = "LoRa 2 ID",
|
@@ -203,18 +187,36 @@ with gr.Blocks(css=css) as demo:
|
|
203 |
allow_custom_value = True
|
204 |
#placeholder = "username/model_id"
|
205 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
label = "LoRa
|
210 |
placeholder = "username/model_id"
|
211 |
)
|
212 |
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
load_models_btn = gr.Button("Load models and .safetensors")
|
219 |
|
220 |
# PART 2 • INFERENCE
|
|
|
156 |
)
|
157 |
|
158 |
# PART 1 • MODELS
|
159 |
+
if not is_shared_ui:
|
160 |
+
your_username = api.whoami()["name"]
|
161 |
+
my_models = api.list_models(author=your_username, filter=["diffusers", "stable-diffusion-xl", 'lora'])
|
162 |
+
model_names = [item.modelId for item in my_models]
|
163 |
|
164 |
+
#print(model_names)
|
165 |
+
|
166 |
+
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
+
with gr.Column():
|
169 |
+
|
170 |
lora_1_id = gr.Dropdown(
|
171 |
label = "LoRa 1 ID",
|
172 |
choices = model_names,
|
173 |
allow_custom_value = True
|
174 |
#placeholder = "username/model_id"
|
175 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
+
lora_1_sfts = gr.Dropdown(
|
178 |
+
label = "Safetensors file",
|
179 |
+
visible=False
|
180 |
+
)
|
181 |
+
|
182 |
+
with gr.Column():
|
183 |
|
184 |
lora_2_id = gr.Dropdown(
|
185 |
label = "LoRa 2 ID",
|
|
|
187 |
allow_custom_value = True
|
188 |
#placeholder = "username/model_id"
|
189 |
)
|
190 |
+
|
191 |
+
lora_2_sfts = gr.Dropdown(
|
192 |
+
label = "Safetensors file",
|
193 |
+
visible=False
|
194 |
+
)
|
195 |
+
else:
|
196 |
+
with gr.Row():
|
197 |
|
198 |
+
with gr.Column():
|
199 |
+
lora_1_id = gr.Textbox(
|
200 |
+
label = "LoRa 1 ID",
|
201 |
placeholder = "username/model_id"
|
202 |
)
|
203 |
|
204 |
+
lora_1_sfts = gr.Dropdown(
|
205 |
+
label = "Safetensors file",
|
206 |
+
visible=False
|
207 |
+
)
|
208 |
|
209 |
+
with gr.Column():
|
210 |
+
lora_2_id = gr.Textbox(
|
211 |
+
label = "LoRa 2 ID",
|
212 |
+
placeholder = "username/model_id"
|
213 |
+
)
|
214 |
+
|
215 |
+
lora_2_sfts = gr.Dropdown(
|
216 |
+
label = "Safetensors file",
|
217 |
+
visible=False
|
218 |
+
)
|
219 |
+
|
220 |
load_models_btn = gr.Button("Load models and .safetensors")
|
221 |
|
222 |
# PART 2 • INFERENCE
|