6
6
getAvoidancePromptExamplesNumber , getMaskColorStr
7
7
)
8
8
from replacer import replacer_scripts
9
- from replacer .ui .tools_ui import IS_WEBUI_1_9 , AttrDict , IS_WEBUI_1_5
9
+ from replacer .ui .tools_ui import IS_WEBUI_1_9 , AttrDict , IS_WEBUI_1_5 , setCustomScriptSourceForComponents
10
10
11
11
12
12
@@ -179,6 +179,7 @@ def makeAdvancedOptions(comp: AttrDict, isDedicatedPage: bool):
179
179
elem_id = "replacer_mask_mode" )
180
180
181
181
comp .soft_inpaint_inputs = []
182
+ setCustomScriptSourceForComponents ("soft_inpainting" )
182
183
if replacer_scripts .script_soft_inpaint :
183
184
try :
184
185
with gr .Row ():
@@ -195,6 +196,7 @@ def makeAdvancedOptions(comp: AttrDict, isDedicatedPage: bool):
195
196
except Exception as e :
196
197
errors .report (f"Cannot add soft inpaint accordion { e } " , exc_info = True )
197
198
replacer_scripts .script_soft_inpaint = None
199
+ setCustomScriptSourceForComponents (None )
198
200
199
201
200
202
with gr .Tab ('Avoidance' ):
@@ -266,6 +268,7 @@ def makeAdvancedOptions(comp: AttrDict, isDedicatedPage: bool):
266
268
if IS_WEBUI_1_5 :
267
269
comp .custom_mask_brush_color .visible = False
268
270
271
+ setCustomScriptSourceForComponents ("inpaint_diff" )
269
272
with (gr .Tab ('Inpaint Diff' ) if replacer_scripts .InpaintDifferenceGlobals
270
273
else gr .Group ()) as comp .inpaint_diff_tab :
271
274
with gr .Row ():
@@ -298,4 +301,5 @@ def makeAdvancedOptions(comp: AttrDict, isDedicatedPage: bool):
298
301
if not replacer_scripts .InpaintDifferenceGlobals :
299
302
comp .inpaint_diff_tab .visible = False
300
303
comp .inpaint_diff_tab .render = False
304
+ setCustomScriptSourceForComponents (None )
301
305
0 commit comments