ComfyUI_smZNodes icon indicating copy to clipboard operation
ComfyUI_smZNodes copied to clipboard

Negpip support

Open pamparamm opened this issue 3 months ago • 0 comments

Should resolve #12 and kinda resolves #28 (incorporates functionality from negpip node but still makes it incompatible)

Based on https://github.com/laksjdjf/cd-tuner_negpip-ComfyUI Makes it possible to use negative weights in prompts. Since patching attn2 is required for negpip to work, it's necessary to hook into default sd1_clip.ClipTokenWeightEncoder.encode_token_weights function.

Without negative weights everything should work exactly the same.

Not sure if the part under opts.prompt_mean_norm is correct (it works for negative weights, but the means for zk and zv are different, could lead to some strange effects)

pamparamm avatar Apr 17 '24 23:04 pamparamm