mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Renamed ControlNet control_mode option "even_more_control" to "unbalanced"
This commit is contained in:
parent
cfd49e3921
commit
5cd0e90816
@ -94,7 +94,7 @@ CONTROLNET_DEFAULT_MODELS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
CONTROLNET_NAME_VALUES = Literal[tuple(CONTROLNET_DEFAULT_MODELS)]
|
CONTROLNET_NAME_VALUES = Literal[tuple(CONTROLNET_DEFAULT_MODELS)]
|
||||||
CONTROLNET_MODE_VALUES = Literal[tuple(["balanced", "more_prompt", "more_control", "even_more_control"])]
|
CONTROLNET_MODE_VALUES = Literal[tuple(["balanced", "more_prompt", "more_control", "unbalanced"])]
|
||||||
|
|
||||||
class ControlField(BaseModel):
|
class ControlField(BaseModel):
|
||||||
image: ImageField = Field(default=None, description="The control image")
|
image: ImageField = Field(default=None, description="The control image")
|
||||||
|
@ -676,7 +676,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
|
|||||||
soft_injection = (control_mode == "more_prompt" or control_mode == "more_control")
|
soft_injection = (control_mode == "more_prompt" or control_mode == "more_control")
|
||||||
# cfg_injection = determines whether to apply ControlNet to only the conditional (if True)
|
# cfg_injection = determines whether to apply ControlNet to only the conditional (if True)
|
||||||
# or the default both conditional and unconditional (if False)
|
# or the default both conditional and unconditional (if False)
|
||||||
cfg_injection = (control_mode == "more_control" or control_mode == "even_more_control")
|
cfg_injection = (control_mode == "more_control" or control_mode == "unbalanced")
|
||||||
|
|
||||||
first_control_step = math.floor(control_datum.begin_step_percent * total_step_count)
|
first_control_step = math.floor(control_datum.begin_step_percent * total_step_count)
|
||||||
last_control_step = math.ceil(control_datum.end_step_percent * total_step_count)
|
last_control_step = math.ceil(control_datum.end_step_percent * total_step_count)
|
||||||
@ -1091,7 +1091,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
|
|||||||
repeat_by = num_images_per_prompt
|
repeat_by = num_images_per_prompt
|
||||||
image = image.repeat_interleave(repeat_by, dim=0)
|
image = image.repeat_interleave(repeat_by, dim=0)
|
||||||
image = image.to(device=device, dtype=dtype)
|
image = image.to(device=device, dtype=dtype)
|
||||||
cfg_injection = (control_mode == "more_control" or control_mode == "even_more_control")
|
cfg_injection = (control_mode == "more_control" or control_mode == "unbalanced")
|
||||||
if do_classifier_free_guidance and not cfg_injection:
|
if do_classifier_free_guidance and not cfg_injection:
|
||||||
image = torch.cat([image] * 2)
|
image = torch.cat([image] * 2)
|
||||||
return image
|
return image
|
||||||
|
Loading…
Reference in New Issue
Block a user