This commit is contained in:
lllyasviel
2024-01-28 09:02:50 -08:00
parent b2569c0183
commit ab49b8a07e
3 changed files with 7 additions and 7 deletions

View File

@@ -455,9 +455,9 @@ class ControlNetExampleForge(scripts.Script):
'output': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
}
negative_advanced_weighting = {
'input': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2],
'middle': [1.0],
'output': [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
'input': [0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, 1.05, 1.15, 1.25],
'middle': [1.05],
'output': [0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, 1.05, 1.15, 1.25]
}
# The advanced_frame_weighting is a weight applied to each image in a batch.
@@ -480,7 +480,7 @@ class ControlNetExampleForge(scripts.Script):
advanced_frame_weighting = None
advanced_sigma_weighting = None
unet = apply_controlnet_advanced(unet=unet, controlnet=self.model, image_bhwc=control_image,
unet = apply_controlnet_advanced(unet=unet, controlnet=self.model, image_bchw=control_image.movedim(-1, 1),
strength=0.6, start_percent=0.0, end_percent=0.8,
positive_advanced_weighting=positive_advanced_weighting,
negative_advanced_weighting=negative_advanced_weighting,

View File

@@ -130,7 +130,7 @@ class ControlNetExampleForge(scripts.Script):
advanced_frame_weighting = None
advanced_sigma_weighting = None
unet = apply_controlnet_advanced(unet=unet, controlnet=self.model, image_bhwc=control_image,
unet = apply_controlnet_advanced(unet=unet, controlnet=self.model, image_bchw=control_image.movedim(-1, 1),
strength=0.6, start_percent=0.0, end_percent=0.8,
positive_advanced_weighting=positive_advanced_weighting,
negative_advanced_weighting=negative_advanced_weighting,

View File

@@ -8,7 +8,7 @@ def get_at(array, index, default=None):
def apply_controlnet_advanced(
unet,
controlnet,
image_bhwc,
image_bchw,
strength,
start_percent,
end_percent,
@@ -55,7 +55,7 @@ def apply_controlnet_advanced(
"""
cnet = controlnet.copy().set_cond_hint(image_bhwc.movedim(-1, 1), strength, (start_percent, end_percent))
cnet = controlnet.copy().set_cond_hint(image_bchw, strength, (start_percent, end_percent))
cnet.positive_advanced_weighting = positive_advanced_weighting
cnet.negative_advanced_weighting = negative_advanced_weighting
cnet.advanced_frame_weighting = advanced_frame_weighting