Skip to content

Repository files navigation

Seed Variance Enhancer - Krea 2 Turbo

A ComfyUI custom node that adds seed-dependent noise to the text conditioning to increase output diversity. Port of SeedVarianceEnhancer v2.2 (by ChangeTheConstants, MIT-0) retuned for Krea 2 Turbo (8-step distilled, guidance_scale=0.0, Qwen3-VL 4B text encoder).

Troubleshooting: little or no variation (read this first)

If outputs barely change, work through this in order:

  1. Set THIS node's seed to randomize or increment. The noise is keyed to the node's own seed, not the KSampler seed. If it is left fixed, every run gets the same embedding noise, so on a low-variance Turbo model the images stay nearly identical. This is the most common cause.

  2. Confirm the noised conditioning actually reaches the sampler. The official Krea 2 template uses subgraphs and a Prompt Enhancer. Make sure the chain is CLIPTextEncode -> this node -> KSampler (positive) on the path that really feeds the sampler, not a dead branch. Quick test: set auto_strength_factor to 5-10, or noise_insert = noise on all steps with randomize_percent 80, and generate. If the image breaks apart, wiring is correct (just dial back). If it does not change at all, the node is not in the active path.

  3. Turn on log_to_console and read the numbers. It prints: embedding_std, effective_strength, real_tokens, values_noised, and L2_perturbation (how much the conditioning actually moved). If L2_perturbation is under ~1%, raise auto_strength_factor. If it is 30%+ but the image still does not change, the problem is wiring or the fixed-seed issue above, not strength.

  4. Use a longer prompt / encode the Prompt-Enhancer output. More prompt tokens give the node more values to perturb, which (counter-intuitively) increases diversity. Place this node after the enhancer's CLIPTextEncode.

  5. Widen the noise window for 8 steps. steps_switchover_percent 25 covers ~the first 2 of 8 steps; try 35-40 for the first 3 if structure stays locked.

New in v1.2.0

  • diagnostics STRING output — the node now has a second output carrying the same text as log_to_console (std, effective strength, L2 perturbation, hints). Wire it to a "Show Text" node to see whether the noise is working without reading the console.
  • noise_distribution: uniform / gaussian — gaussian matches the bell-curve statistics of the embedding itself and tends to produce fewer broken outputs at the same strength. Power-matched: the same strength gives the same overall perturbation with either distribution. Default remains uniform (identical to previous versions).
  • granularity: values / tokensvalues scatters noise across individual embedding values (original behavior); tokens perturbs whole tokens at once, giving more "semantic" variations where subjects, props, and composition shift together. With tokens, randomize_percent selects tokens instead of values.

Workflows saved with older versions load unchanged: the new widgets are appended at the end and fall back to their defaults.

What changed vs. the Z-Image build

  • auto_strength_factor - noise scale self-calibrates to the measured embedding std (effective_strength = std * factor), so the right strength transfers across text encoders. Z-Image and Krea 2 (Qwen3-VL 4B) have different embedding scales.
  • Verbose diagnostics in log_to_console (real-token count, effective strength, % values noised, L2 perturbation) to debug weak/no variation.
  • RNG isolation - the global torch RNG state is saved and restored around noise generation, so the node never disturbs the sampler's own noise.
  • Tolerant padding detection (near-zero rows, not only exact zeros) + a warning when the measured std is near zero.
  • Robustness fix - noise on all steps no longer errors when the internal SVH_tag key is absent.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/harukimix/KreaSeedVarianceEnhancer.git

Restart ComfyUI. The node appears as "Seed Variance Enhancer - Krea 2 Turbo" under advanced/conditioning.

Wiring

[Prompt] -> [CLIPTextEncode (Qwen3-VL 4B / type=krea2)] -> [Seed Variance Enhancer - Krea 2 Turbo] -> KSampler (positive)

Leave the negative path untouched. Krea 2 Turbo runs with CFG off (guidance_scale=0.0), so only the positive conditioning drives generation - which is exactly what this node modifies.

Recommended settings (Krea 2 Turbo, 8 steps)

Setting Start with Notes
seed (this node) randomize / increment Must vary between runs to get different variations.
auto_strength_factor 1.0 0.5 subtle, 1.0 balanced, 3-5 strong. 0 = use manual strength.
randomize_percent 50 Higher = more diversity, less adherence.
noise_insert noise on beginning steps Perturb early structure, recover the prompt after.
steps_switchover_percent 25 At 8 steps: 25 ~ first 2 steps, 38 ~ first 3 steps.
mask_percent 0 Raise (with mask_starts_at) to protect a subject or rendered text.
log_to_console true (while tuning) Shows the actual perturbation; turn off once dialed in.
strength 20 Only used when auto_strength_factor is 0.
noise_distribution uniform Try gaussian for gentler, less break-prone variation at the same strength.
granularity values Try tokens for more semantic variations (whole words shift together).

Tuning

  • Too much drift -> lower auto_strength_factor / randomize_percent / steps_switchover_percent.
  • Not enough variety -> raise auto_strength_factor toward 3-5, or try noise on all steps.
  • Garbled text -> protect part of the prompt with mask_percent, or lower strength.

Credit / license

Based on SeedVarianceEnhancer v2.2 by ChangeTheConstants, MIT No Attribution License (MIT-0). This adaptation is provided under the same terms.

About

No description, website, or topics provided.

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages