diff --git a/README.md b/README.md index f5c88e4..c9ca1b3 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ downstream of this node — that works generically at the sampler level.) | `image1…N` | IMAGE | Optional reference images; slots grow as you connect them. | | `mask1…N` | MASK | Optional per-image mask; crops `imageN` to the masked bounding box. | | `mask_padding` | FLOAT | Context kept around the mask, as a fraction of image size per side (`0` = tight, default). | -| `vision_strength` | FLOAT | How strongly references influence the result. `1.0` = full; lower fades toward neutral gray (`0.0` ≈ text-only). | | `vision_megapixels` | FLOAT | Max size before the vision encoder; references are downscaled to this cap, never upscaled (default `1.0`). | Output is a standard `CONDITIONING` for the Krea2 sampler. With no images connected it diff --git a/nodes.py b/nodes.py index f3bd87e..96d78f7 100644 --- a/nodes.py +++ b/nodes.py @@ -60,13 +60,6 @@ class TextEncodeKrea2: "image size added on EACH side. 0 = tight crop to the mask; 0.1 = ~10% " "margin of surroundings. Only applies when a mask is connected.", }), - "vision_strength": ("FLOAT", { - "default": 1.0, "min": 0.0, "max": 1.0, "step": 0.05, - "tooltip": "How strongly each reference image influences the result. 1.0 = full; " - "lower fades the image toward neutral gray (which Qwen3-VL reads as ~no " - "signal) so the VLM keys off it less. 0.0 = effectively text-only. For " - "stronger-than-full influence, raise vision_megapixels instead.", - }), }, } @@ -123,15 +116,7 @@ class TextEncodeKrea2: return image[:, y0:y1 + 1, x0:x1 + 1, :] - @staticmethod - def _apply_vision_strength(image, strength): - """Lerp the reference toward neutral gray (0.5). Qwen3-VL normalizes with - mean/std 0.5, so 0.5 gray -> ~zero vision signal; strength dials influence.""" - if strength >= 1.0: - return image - return (0.5 + strength * (image - 0.5)).clamp(0.0, 1.0) - - def encode(self, clip, prompt, vision_megapixels=1.0, mask_padding=0.0, vision_strength=1.0, **kwargs): + def encode(self, clip, prompt, vision_megapixels=1.0, mask_padding=0.0, **kwargs): images = self._collect_indexed(kwargs, "image") masks = self._collect_indexed(kwargs, "mask") ordered = sorted(images.keys()) @@ -152,8 +137,7 @@ class TextEncodeKrea2: height = round(samples.shape[2] * scale_by) s = comfy.utils.common_upscale(samples, width, height, "area", "disabled") - vl = self._apply_vision_strength(s.movedim(1, -1)[:, :, :, :3], vision_strength) - images_vl.append(vl) + images_vl.append(s.movedim(1, -1)[:, :, :, :3]) if len(ordered) > 1: image_prompt += "Picture {}: <|vision_start|><|image_pad|><|vision_end|>".format(slot + 1)