Update Garage/models/PowerPaintModel.py
Browse files
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 |
-
|
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 |
-
|
68 |
-
subfolder="unet",
|
69 |
revision=None,
|
70 |
torch_dtype=self.weight_dtype
|
71 |
)
|
72 |
|
73 |
pipe.tokenizer = TokenizerWrapper(
|
74 |
-
from_pretrained=
|
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(
|
91 |
)
|
92 |
|
93 |
pipe.text_encoder_brushnet.load_state_dict(
|
94 |
-
torch.load(os.path.join(
|
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)
|