Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Add basic style model "multiply" strength.

comfyanonymous3fc6ebcdd722
diff --git a/nodes.py b/nodes.py
index 6907bd4de..fb504da35 100644
--- a/nodes.py
+++ b/nodes.py
@@ -1008,14 +1008,19 @@ class StyleModelApply:
return {"required": {"conditioning": ("CONDITIONING", ),
"style_model": ("STYLE_MODEL", ),
"clip_vision_output": ("CLIP_VISION_OUTPUT", ),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.001}),
+ "strength_type": (["multiply"], ),
}}
RETURN_TYPES = ("CONDITIONING",)
FUNCTION = "apply_stylemodel"
CATEGORY = "conditioning/style_model"
- def apply_stylemodel(self, clip_vision_output, style_model, conditioning):
+ def apply_stylemodel(self, clip_vision_output, style_model, conditioning, strength, strength_type):
cond = style_model.get_cond(clip_vision_output).flatten(start_dim=0, end_dim=1).unsqueeze(dim=0)
+ if strength_type == "multiply":
+ cond *= strength
+
c = []
for t in conditioning:
n = [torch.cat((t[0], cond), dim=1), t[1].copy()]