Spaces:
Running
on
Zero
Running
on
Zero
Remove Style Dropdown
Browse files
app.py
CHANGED
@@ -687,7 +687,7 @@ def update_selection(evt: gr.SelectData, aspect_ratio):
|
|
687 |
# (Optionally, you could log or use new_width/new_height as needed)
|
688 |
except Exception as e:
|
689 |
print(f"\nError in update selection aspect ratios: {e}\nSkipping")
|
690 |
-
return [gr.update(value=lora_repo), gr.update(
|
691 |
|
692 |
def on_prerendered_gallery_selection(event_data: gr.SelectData):
|
693 |
global current_prerendered_image
|
@@ -1208,12 +1208,12 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
1208 |
with gr.Accordion("Generate AI Image (click here for options)", open = False):
|
1209 |
with gr.Row():
|
1210 |
with gr.Column():
|
1211 |
-
model_options = gr.Dropdown(
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
)
|
1217 |
model_textbox = gr.Textbox(
|
1218 |
label="LORA/Model",
|
1219 |
value="Cossale/Frames2-Flex.1",
|
@@ -1222,7 +1222,7 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
1222 |
lines=2,
|
1223 |
visible=False
|
1224 |
)
|
1225 |
-
with gr.Accordion("Choose Style Model*", open=
|
1226 |
lora_gallery = gr.Gallery(
|
1227 |
[(open_image(image_path), title) for image_path, title in lora_models],
|
1228 |
label="Styles",
|
@@ -1295,8 +1295,7 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
1295 |
# Gallery from PRE_RENDERED_IMAGES GOES HERE
|
1296 |
prerendered_image_gallery = gr.Gallery(label="Image Gallery", show_label=True, value=build_prerendered_images_by_quality(3,'thumbnail'), elem_id="gallery",
|
1297 |
elem_classes="solid", type="filepath", columns=[3], rows=[3], preview=False ,object_fit="contain", height="auto", format="png",allow_preview=False)
|
1298 |
-
with gr.Column():
|
1299 |
-
image_guidance_stength = gr.Slider(label="Image Guidance Strength (prompt percentage)", minimum=0, maximum=1.0, value=0.85, step=0.01, interactive=True)
|
1300 |
replace_input_image_button = gr.Button(
|
1301 |
"Replace Input Image",
|
1302 |
elem_id="prerendered_replace_input_image_button",
|
@@ -1307,6 +1306,7 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
1307 |
elem_id="generate_input_image_from_gallery",
|
1308 |
elem_classes="solid"
|
1309 |
)
|
|
|
1310 |
|
1311 |
with gr.Accordion("Advanced Hexagon Settings", open = False):
|
1312 |
with gr.Row():
|
@@ -1479,20 +1479,20 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
1479 |
inputs=model_textbox,
|
1480 |
outputs=prompt_notes_label,preprocess=False
|
1481 |
)
|
1482 |
-
model_options.change(
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
)
|
1487 |
-
model_options.change(
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
)
|
1492 |
lora_gallery.select(
|
1493 |
fn=update_selection,
|
1494 |
inputs=[image_size_ratio],
|
1495 |
-
outputs=[model_textbox,
|
1496 |
)
|
1497 |
|
1498 |
#################### model end ########################################
|
|
|
687 |
# (Optionally, you could log or use new_width/new_height as needed)
|
688 |
except Exception as e:
|
689 |
print(f"\nError in update selection aspect ratios: {e}\nSkipping")
|
690 |
+
return [gr.update(value=lora_repo), gr.update(visible=(lora_repo == "Manual Entry")), evt.index, new_aspect_ratio, upd_prompt_notes_by_index(evt.index)]
|
691 |
|
692 |
def on_prerendered_gallery_selection(event_data: gr.SelectData):
|
693 |
global current_prerendered_image
|
|
|
1208 |
with gr.Accordion("Generate AI Image (click here for options)", open = False):
|
1209 |
with gr.Row():
|
1210 |
with gr.Column():
|
1211 |
+
# model_options = gr.Dropdown(
|
1212 |
+
# label="Choose an AI Model*",
|
1213 |
+
# choices=constants.MODELS + constants.LORA_WEIGHTS + ["Manual Entry"],
|
1214 |
+
# value="Cossale/Frames2-Flex.1",
|
1215 |
+
# elem_classes="solid"
|
1216 |
+
# )
|
1217 |
model_textbox = gr.Textbox(
|
1218 |
label="LORA/Model",
|
1219 |
value="Cossale/Frames2-Flex.1",
|
|
|
1222 |
lines=2,
|
1223 |
visible=False
|
1224 |
)
|
1225 |
+
with gr.Accordion("Choose Style Model*", open=True):
|
1226 |
lora_gallery = gr.Gallery(
|
1227 |
[(open_image(image_path), title) for image_path, title in lora_models],
|
1228 |
label="Styles",
|
|
|
1295 |
# Gallery from PRE_RENDERED_IMAGES GOES HERE
|
1296 |
prerendered_image_gallery = gr.Gallery(label="Image Gallery", show_label=True, value=build_prerendered_images_by_quality(3,'thumbnail'), elem_id="gallery",
|
1297 |
elem_classes="solid", type="filepath", columns=[3], rows=[3], preview=False ,object_fit="contain", height="auto", format="png",allow_preview=False)
|
1298 |
+
with gr.Column():
|
|
|
1299 |
replace_input_image_button = gr.Button(
|
1300 |
"Replace Input Image",
|
1301 |
elem_id="prerendered_replace_input_image_button",
|
|
|
1306 |
elem_id="generate_input_image_from_gallery",
|
1307 |
elem_classes="solid"
|
1308 |
)
|
1309 |
+
image_guidance_stength = gr.Slider(label="Image Guidance Strength (prompt percentage)", minimum=0, maximum=1.0, value=0.85, step=0.01, interactive=True)
|
1310 |
|
1311 |
with gr.Accordion("Advanced Hexagon Settings", open = False):
|
1312 |
with gr.Row():
|
|
|
1479 |
inputs=model_textbox,
|
1480 |
outputs=prompt_notes_label,preprocess=False
|
1481 |
)
|
1482 |
+
# model_options.change(
|
1483 |
+
# fn=lambda x: (gr.update(visible=(x == "Manual Entry")), gr.update(value=x) if x != "Manual Entry" else gr.update()),
|
1484 |
+
# inputs=model_options,
|
1485 |
+
# outputs=[model_textbox, model_textbox]
|
1486 |
+
# )
|
1487 |
+
# model_options.change(
|
1488 |
+
# fn=update_prompt_notes,
|
1489 |
+
# inputs=model_options,
|
1490 |
+
# outputs=prompt_notes_label
|
1491 |
+
# )
|
1492 |
lora_gallery.select(
|
1493 |
fn=update_selection,
|
1494 |
inputs=[image_size_ratio],
|
1495 |
+
outputs=[model_textbox, model_textbox, gr.State(selected_index), image_size_ratio, prompt_notes_label]
|
1496 |
)
|
1497 |
|
1498 |
#################### model end ########################################
|