Unverified Commit 9146a588 authored by uservar's avatar uservar Committed by GitHub

Better should hijack inpainting detection

parent 9e78d2c4
import os
import torch import torch
from einops import repeat from einops import repeat
...@@ -319,7 +320,9 @@ class LatentInpaintDiffusion(LatentDiffusion): ...@@ -319,7 +320,9 @@ class LatentInpaintDiffusion(LatentDiffusion):
def should_hijack_inpainting(checkpoint_info): def should_hijack_inpainting(checkpoint_info):
return str(checkpoint_info.filename).endswith("inpainting.ckpt") and not checkpoint_info.config.endswith("inpainting.yaml") ckpt_basename = os.path.basename(checkpoint_info.filename).lower()
cfg_basename = os.path.basename(checkpoint_info.config).lower()
return "inpainting" in ckpt_basename and not "inpainting" in cfg_basename
def do_inpainting_hijack(): def do_inpainting_hijack():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment