anvilarth commited on
Commit
a100d9f
·
verified ·
1 Parent(s): a5f4235

Update Garage/models/PowerPaintModel.py

Browse files
Files changed (1) hide show
  1. Garage/models/PowerPaintModel.py +7 -7
Garage/models/PowerPaintModel.py CHANGED
@@ -54,7 +54,7 @@ class PowerPaintModel:
54
  brushnet = BrushNetModel.from_unet(unet)
55
  base_model_path = os.path.join(self.model_name, "realisticVisionV60B1_v51VAE")
56
  pipe = StableDiffusionPowerPaintBrushNetPipeline.from_pretrained(
57
- self.model_name,
58
  subfolder="realisticVisionV60B1_v51VAE",
59
  brushnet=brushnet,
60
  text_encoder_brushnet=text_encoder_brushnet,
@@ -64,15 +64,15 @@ class PowerPaintModel:
64
  )
65
 
66
  pipe.unet = UNet2DConditionModel.from_pretrained(
67
- base_model_path,
68
- subfolder="unet",
69
  revision=None,
70
  torch_dtype=self.weight_dtype
71
  )
72
 
73
  pipe.tokenizer = TokenizerWrapper(
74
- from_pretrained=base_model_path,
75
- subfolder="tokenizer",
76
  revision=None,
77
  torch_type=self.weight_dtype
78
  )
@@ -87,11 +87,11 @@ class PowerPaintModel:
87
 
88
  load_model(
89
  pipe.brushnet,
90
- os.path.join(base_model_path, "PowerPaint_Brushnet/diffusion_pytorch_model.safetensors")
91
  )
92
 
93
  pipe.text_encoder_brushnet.load_state_dict(
94
- torch.load(os.path.join(base_model_path, "PowerPaint_Brushnet/pytorch_model.bin")), strict=False
95
  )
96
 
97
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
 
54
  brushnet = BrushNetModel.from_unet(unet)
55
  base_model_path = os.path.join(self.model_name, "realisticVisionV60B1_v51VAE")
56
  pipe = StableDiffusionPowerPaintBrushNetPipeline.from_pretrained(
57
+ "JunhaoZhuang/PowerPaint-v2-1",
58
  subfolder="realisticVisionV60B1_v51VAE",
59
  brushnet=brushnet,
60
  text_encoder_brushnet=text_encoder_brushnet,
 
64
  )
65
 
66
  pipe.unet = UNet2DConditionModel.from_pretrained(
67
+ "JunhaoZhuang/PowerPaint-v2-1",
68
+ subfolder="realisticVisionV60B1_v51VAE/unet",
69
  revision=None,
70
  torch_dtype=self.weight_dtype
71
  )
72
 
73
  pipe.tokenizer = TokenizerWrapper(
74
+ from_pretrained= "JunhaoZhuang/PowerPaint-v2-1",
75
+ subfolder="realisticVisionV60B1_v51VAE/tokenizer",
76
  revision=None,
77
  torch_type=self.weight_dtype
78
  )
 
87
 
88
  load_model(
89
  pipe.brushnet,
90
+ os.path.join( "JunhaoZhuang/PowerPaint-v2-1", "PowerPaint_Brushnet/diffusion_pytorch_model.safetensors")
91
  )
92
 
93
  pipe.text_encoder_brushnet.load_state_dict(
94
+ torch.load(os.path.join("JunhaoZhuang/PowerPaint-v2-1", "PowerPaint_Brushnet/pytorch_model.bin")), strict=False
95
  )
96
 
97
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)