MCPcopy Index your code
hub / github.com/vladmandic/sdnext / initialize_scripts

Method initialize_scripts

modules/scripts_manager.py:409–438  ·  view source on GitHub ↗
(self, is_img2img=False, is_control=False)

Source from the content-addressed store, hash-verified

407 errors.display(e, 'script')
408
409 def initialize_scripts(self, is_img2img=False, is_control=False):
410 from modules import scripts_auto_postprocessing
411
412 self.scripts.clear()
413 self.selectable_scripts.clear()
414 self.alwayson_scripts.clear()
415 self.titles.clear()
416 self.alwayson_titles.clear()
417 self.infotext_fields.clear()
418 self.paste_field_names.clear()
419 self.script_load_ctr = 0
420 self.is_img2img = is_img2img
421 self.scripts.clear()
422 self.alwayson_scripts.clear()
423 self.selectable_scripts.clear()
424 self.auto_processing_scripts = scripts_auto_postprocessing.create_auto_preprocessing_script_data()
425
426 try:
427 sorted_scripts = sorted(scripts_data, key=lambda x: x.script_class().title().lower())
428 except Exception:
429 sorted_scripts = scripts_data
430 for script_class, path, _basedir, _script_module in sorted_scripts:
431 self.add_script(script_class, path, is_img2img, is_control)
432
433 try:
434 sorted_scripts = sorted(self.auto_processing_scripts, key=lambda x: x.script_class().title().lower())
435 except Exception:
436 sorted_scripts = self.auto_processing_scripts
437 for script_class, path, _basedir, _script_module in sorted_scripts:
438 self.add_script(script_class, path, is_img2img, is_control)
439
440 def prepare_ui(self):
441 self.inputs = [None]

Callers 6

create_uiFunction · 0.45
initializeFunction · 0.45
create_uiFunction · 0.45
control_processFunction · 0.45
post_text2imgMethod · 0.45
post_img2imgMethod · 0.45

Calls 3

add_scriptMethod · 0.95
clearMethod · 0.45
titleMethod · 0.45

Tested by

no test coverage detected