19
19
from PIL import Image , PngImagePlugin
20
20
21
21
22
- from modules import sd_hijack , sd_models , localization , script_callbacks
22
+ from modules import sd_hijack , sd_models , localization , script_callbacks , ui_extensions
23
23
from modules .paths import script_path
24
24
25
25
from modules .shared import opts , cmd_opts , restricted_opts
@@ -671,6 +671,7 @@ def create_ui(wrap_gradio_gpu_call):
671
671
import modules .img2img
672
672
import modules .txt2img
673
673
674
+ parameters_copypaste .reset ()
674
675
675
676
with gr .Blocks (analytics_enabled = False ) as txt2img_interface :
676
677
txt2img_prompt , roll , txt2img_prompt_style , txt2img_negative_prompt , txt2img_prompt_style2 , submit , _ , _ , txt2img_prompt_style_apply , txt2img_save_style , txt2img_paste , token_counter , token_button = create_toprow (is_img2img = False )
@@ -1511,8 +1512,9 @@ def run_settings_single(value, key):
1511
1512
column = None
1512
1513
with gr .Row (elem_id = "settings" ).style (equal_height = False ):
1513
1514
for i , (k , item ) in enumerate (opts .data_labels .items ()):
1515
+ section_must_be_skipped = item .section [0 ] is None
1514
1516
1515
- if previous_section != item .section :
1517
+ if previous_section != item .section and not section_must_be_skipped :
1516
1518
if cols_displayed < settings_cols and (items_displayed >= items_per_col or previous_section is None ):
1517
1519
if column is not None :
1518
1520
column .__exit__ ()
@@ -1531,6 +1533,8 @@ def run_settings_single(value, key):
1531
1533
if k in quicksettings_names and not shared .cmd_opts .freeze_settings :
1532
1534
quicksettings_list .append ((i , k , item ))
1533
1535
components .append (dummy_component )
1536
+ elif section_must_be_skipped :
1537
+ components .append (dummy_component )
1534
1538
else :
1535
1539
component = create_setting_component (k )
1536
1540
component_dict [k ] = component
@@ -1572,9 +1576,10 @@ def reload_scripts():
1572
1576
1573
1577
def request_restart ():
1574
1578
shared .state .interrupt ()
1575
- settings_interface . gradio_ref . do_restart = True
1579
+ shared . state . need_restart = True
1576
1580
1577
1581
restart_gradio .click (
1582
+
1578
1583
fn = request_restart ,
1579
1584
inputs = [],
1580
1585
outputs = [],
@@ -1612,14 +1617,15 @@ def request_restart():
1612
1617
interfaces += script_callbacks .ui_tabs_callback ()
1613
1618
interfaces += [(settings_interface , "Settings" , "settings" )]
1614
1619
1620
+ extensions_interface = ui_extensions .create_ui ()
1621
+ interfaces += [(extensions_interface , "Extensions" , "extensions" )]
1622
+
1615
1623
with gr .Blocks (css = css , analytics_enabled = False , title = "Stable Diffusion" ) as demo :
1616
1624
with gr .Row (elem_id = "quicksettings" ):
1617
1625
for i , k , item in quicksettings_list :
1618
1626
component = create_setting_component (k , is_quicksettings = True )
1619
1627
component_dict [k ] = component
1620
1628
1621
- settings_interface .gradio_ref = demo
1622
-
1623
1629
parameters_copypaste .integrate_settings_paste_fields (component_dict )
1624
1630
parameters_copypaste .run_bind ()
1625
1631
0 commit comments