Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpark committed Oct 14, 2023
1 parent e8b1a15 commit 1ecf93b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/model_mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ def after_component(self, component, **_kwargs):
MM = ModelMixerScript

elem_id = getattr(component, "elem_id", None)
if elem_id is None:
return

if elem_id in [ "txt2img_generate", "img2img_generate" ]:
MM.components[elem_id] = component
return
Expand Down Expand Up @@ -1094,6 +1097,7 @@ def import_image_from_gallery(gallery):

def on_after_components(component, **kwargs):
nonlocal input_image
self.init_on_after_callback = True
MM = ModelMixerScript

elem_id = getattr(component, "elem_id", None)
Expand Down Expand Up @@ -1153,7 +1157,6 @@ def on_after_components(component, **kwargs):
outputs=[is_sdxl, model_a, component],
show_progress=False,
)
self.init_on_after_callback = True

enable_sync.select(fn=sync_main_checkpoint,
inputs=[enable_sync, model_a],
Expand Down Expand Up @@ -1207,8 +1210,6 @@ def model_metadata(model):
)

# load settings
print("checkpoint title = ", shared.sd_model.sd_checkpoint_info.title)

read_metadata.click(fn=current_metadata, inputs=[], outputs=[metadata_json])
read_model_a_metadata.click(fn=model_metadata, inputs=[model_a], outputs=[metadata_json])
read_model_b_metadata.click(fn=model_metadata, inputs=[mm_models[0]], outputs=[metadata_json])
Expand Down

0 comments on commit 1ecf93b

Please sign in to comment.