ComfyUI Node
SonarApplyLatentOperationCFG
Allows applying a LATENT_OPERATION during sampling. ComfyUI has a few that are builtin and this node pack also includes: SonarLatentOperationQuantileFilter.
SonarApplyLatentOperationCFG
- model
- operation_1
- operation_2
- operation_3
- operation_4
- operation_5
- MODEL
◄modecond_sub_uncond►
◄pred_flip_modefalse►
◄require_uncondfalse►
◄start_sigma-1.000►
◄end_sigma0.000►
◄blend_modelerp►
◄blend_strength0.500►
◄blend_scale_modereverse_sampling►
◄blend_scale_offset0.000►
◄blend_scale_min0.000►
◄blend_scale_max1.000►
◄immediate_blendfalse►
Categorylatent/advanced/operations
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| mode | COMBO | cond_sub_uncond | cond_sub_uncond is what ComfyUI's latent operations use. The non-sub_uncond modes likely won't work with pred_flip mode enabled. If you have anything but the denoised options selected, this will use pre-CFG, otherwise it will use post-CFG (unless you are using model_input). |
| pred_flip_mode | BOOLEAN | false | Lets you try to apply the latent operation to the noise prediction rather than the image prediction. Doesn't work properly with the non-sub_uncond modes. No real reason it should be better, just something you can try. Note: The noise prediction gets scaled by the sigma first, in case that's useful information. |
| require_uncond | BOOLEAN | false | When enabled, the operation will be skipped if uncond is unavailable. This will also happen if you choose a mode that requires uncond. |
| start_sigma | FLOAT | -1.000-1–10000 | First sigma the effect becomes active. You can set a negative value here to use whatever the model's maximum sigma is. |
| end_sigma | FLOAT | 0.0000–10000 | Last sigma the effect is active. |
| blend_mode | COMBO | lerp | Controls how the output of the latent operation is blended with the original result. |
| blend_strength | FLOAT | 0.500-10000–10000 | Strength of the blend. For a normal blend mode like LERP, 1.0 means use 100% of the output from the latent operation, 0.0 means use none of it and only the original value. Note: Blending is applied to the final result of the operations unless you enable immediate_blend, in other words operation_2 sees a full unblended result from operation_1. |
| blend_scale_mode | COMBO | reverse_sampling | Can be used to scale the blend strength over time. Basically works like blend_strength * scale_factor (see below) none: Just uses the blend_strength you have set. reverse_sampling: The opposite of the model sampling percent, so if you're making a new generation, the beginning of sampling will be 1.0 and the end will be 0.0. The recommended option as applying these operations usually works better toward the beginning of sampling. sampling: Same as reverse_sampling, except the beginning will be 0.0 and the end will be 1.0. reverse_enabled_range: Flipped percentage of the range between start_sigma and end_sigma. enabled_range: Percentage of the range between start_sigma and end_sigma. sampling_sin: Uses the sampling percentage with the sine function such that blend_strength will hit the peak value in the middle of the range. enabled_range_sin: Similar to sampling_sin except it applies to the percentage of the enabled range. |
| blend_scale_offset | FLOAT | 0.000-1–1 | Only applies when blend_scale_mode is not none. Adds the offset to the calculated percentage and then clamps it to be between blend_scale_min and blend_scale_max. |
| blend_scale_min | FLOAT | 0.000-10000–10000 | Only applies when blend_scale_mode is not none. Minimum value for the blend scale percentage. Many blend modes don't tolerate negative values here. |
| blend_scale_max | FLOAT | 1.000-10000–10000 | Only applies when blend_scale_mode is not none. Maximum value for the blend scale percentage. Many blend modes don't tolerate values over 1.0 here. |
| immediate_blend | BOOLEAN | false | You can enable this to do blending immediately after each latent operation is called. Mainly affects the case where you have multiple latent operations connected. |
| operation_1opt | LATENT_OPERATION | Optional LATENT_OPERATION. The operations will be applied in sequence. | |
| operation_2opt | LATENT_OPERATION | Optional LATENT_OPERATION. The operations will be applied in sequence. | |
| operation_3opt | LATENT_OPERATION | Optional LATENT_OPERATION. The operations will be applied in sequence. | |
| operation_4opt | LATENT_OPERATION | Optional LATENT_OPERATION. The operations will be applied in sequence. | |
| operation_5opt | LATENT_OPERATION | Optional LATENT_OPERATION. The operations will be applied in sequence. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |