Add suport for width and height

This commit is contained in:
bmaltais
2024-01-17 20:48:33 -05:00
parent 6b44ceab41
commit 22068bbd51
2 changed files with 11 additions and 2 deletions
+1
View File
@@ -0,0 +1 @@
__pycache__
+10 -2
View File
@@ -38,6 +38,8 @@ class PhotoMaker_Zho:
"steps": ("INT", {"default": 50, "min": 1, "max": 100, "step": 1, "display": "slider"}),
"guidance_scale": ("FLOAT", {"default": 5, "min": 0.1, "max": 10.0, "step": 0.1, "display": "slider"}),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
"width": ("INT", {"default": 1024, "min": 512, "max": 2048, "step": 32}),
"height": ("INT", {"default": 1024, "min": 512, "max": 2048, "step": 32}),
}
}
@@ -46,7 +48,7 @@ class PhotoMaker_Zho:
FUNCTION = "process_images"
CATEGORY = "📷PhotoMaker"
def process_images(self, base_model_path, ref_image, prompt, negative_prompt, style_name, style_strength_ratio, steps, guidance_scale, seed):
def process_images(self, base_model_path, ref_image, prompt, negative_prompt, style_name, style_strength_ratio, steps, guidance_scale, seed, width, height):
# Load base model
pipe = PhotoMakerStableDiffusionXLPipeline.from_pretrained(
@@ -90,6 +92,8 @@ class PhotoMaker_Zho:
start_merge_step=start_merge_step,
generator=generator,
guidance_scale=guidance_scale,
width=width,
height=height,
return_dict=False
)
@@ -136,6 +140,8 @@ class PhotoMaker_Batch_Zho:
"steps": ("INT", {"default": 50, "min": 1, "max": 100, "step": 1, "display": "slider"}),
"guidance_scale": ("FLOAT", {"default": 5, "min": 0.1, "max": 10.0, "step": 0.1, "display": "slider"}),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
"width": ("INT", {"default": 1024, "min": 512, "max": 2048, "step": 32}),
"height": ("INT", {"default": 1024, "min": 512, "max": 2048, "step": 32}),
}
}
@@ -144,7 +150,7 @@ class PhotoMaker_Batch_Zho:
FUNCTION = "process_images"
CATEGORY = "📷PhotoMaker"
def process_images(self, base_model_path, ref_images_path, prompt, negative_prompt, style_name, style_strength_ratio, steps, guidance_scale, seed):
def process_images(self, base_model_path, ref_images_path, prompt, negative_prompt, style_name, style_strength_ratio, steps, guidance_scale, seed, width, height):
# Load base model
pipe = PhotoMakerStableDiffusionXLPipeline.from_pretrained(
@@ -193,6 +199,8 @@ class PhotoMaker_Batch_Zho:
start_merge_step=start_merge_step,
generator=generator,
guidance_scale=guidance_scale,
width=width,
height=height,
return_dict=False
)