Skip to content

Commit

Permalink
Updated patched functions (round #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonRide303 committed Sep 21, 2023
1 parent b12f1e0 commit 4750e58
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ def patched_unet_forward(self, x, timesteps=None, context=None, y=None, control=
transformer_options["block"] = ("middle", 0)
h = forward_timestep_embed(self.middle_block, h, emb, context, transformer_options)
if control is not None and 'middle' in control and len(control['middle']) > 0:
h += control['middle'].pop()
ctrl = control['middle'].pop()
if ctrl is not None:
h += ctrl

for id, module in enumerate(self.output_blocks):
transformer_options["block"] = ("output", id)
Expand Down Expand Up @@ -431,8 +433,8 @@ def vae_bf16_upsample_forward(self, x):


def patch_all():
comfy.model_management.vae_dtype = vae_dtype_patched
comfy.ldm.modules.diffusionmodules.model.Upsample.forward = vae_bf16_upsample_forward
# comfy.model_management.vae_dtype = vae_dtype_patched
# comfy.ldm.modules.diffusionmodules.model.Upsample.forward = vae_bf16_upsample_forward

# comfy.sd1_clip.SD1ClipModel.forward = patched_SD1ClipModel_forward

Expand Down

0 comments on commit 4750e58

Please sign in to comment.