Add negative prompt to boogu edit node and set min images to 0. (#14529)

This commit is contained in:
comfyanonymous 2026-06-17 15:42:29 -07:00 committed by GitHub
parent e25c391888
commit 52257bb435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -1769,7 +1769,7 @@ class Boogu(Omnigen2):
"shift": 3.16, "shift": 3.16,
} }
memory_usage_factor = 1.95 #TODO memory_usage_factor = 2.15
def get_model(self, state_dict, prefix="", device=None): def get_model(self, state_dict, prefix="", device=None):
out = model_base.Boogu(self, device=device) out = model_base.Boogu(self, device=device)

View File

@ -26,13 +26,14 @@ class TextEncodeBooguEdit(io.ComfyNode):
inputs=[ inputs=[
io.Clip.Input("clip"), io.Clip.Input("clip"),
io.String.Input("prompt", multiline=True, dynamic_prompts=True), io.String.Input("prompt", multiline=True, dynamic_prompts=True),
io.String.Input("negative_prompt", multiline=True, dynamic_prompts=True, advanced=True),
io.Vae.Input("vae"), io.Vae.Input("vae"),
io.Autogrow.Input( io.Autogrow.Input(
"images", "images",
template=io.Autogrow.TemplateNames( template=io.Autogrow.TemplateNames(
io.Image.Input("image"), io.Image.Input("image"),
names=[f"image_{i}" for i in range(1, 17)], names=[f"image_{i}" for i in range(1, 17)],
min=1, min=0,
), ),
tooltip="Reference image(s) to edit. Boogu focuses on one reference per sample; more are allowed.", tooltip="Reference image(s) to edit. Boogu focuses on one reference per sample; more are allowed.",
), ),
@ -44,7 +45,7 @@ class TextEncodeBooguEdit(io.ComfyNode):
) )
@classmethod @classmethod
def execute(cls, clip, prompt, vae=None, images: io.Autogrow.Type = None) -> io.NodeOutput: def execute(cls, clip, prompt, negative_prompt, vae=None, images: io.Autogrow.Type = None) -> io.NodeOutput:
ref_latents = [] ref_latents = []
images_vl = [] images_vl = []
@ -75,7 +76,7 @@ class TextEncodeBooguEdit(io.ComfyNode):
# positive: instruction + vision tokens; negative: empty (no vision). Ref latent on both. # positive: instruction + vision tokens; negative: empty (no vision). Ref latent on both.
positive = clip.encode_from_tokens_scheduled(clip.tokenize(prompt, images=images_vl)) positive = clip.encode_from_tokens_scheduled(clip.tokenize(prompt, images=images_vl))
negative = clip.encode_from_tokens_scheduled(clip.tokenize("")) negative = clip.encode_from_tokens_scheduled(clip.tokenize(negative_prompt))
if len(ref_latents) > 0: if len(ref_latents) > 0:
positive = node_helpers.conditioning_set_values(positive, {"reference_latents": ref_latents}, append=True) positive = node_helpers.conditioning_set_values(positive, {"reference_latents": ref_latents}, append=True)