12 Commits
Author SHA1 Message Date
facok 84fdf78916 Update pyproject.toml 2026-04-25 20:24:35 +08:00
facok f1f307a2dd Update pyproject.toml 2026-04-25 20:16:43 +08:00
facok f10953dd9e Add Comfy Registry publishing 2026-04-25 20:05:49 +08:00
facok 4d6794e7c5 Release V3: polynomial frequency modulation + legacy node
Major rewrite of DiversityBoost core:

- Replace Butterworth LPF with polynomial frequency modulation
  (smooth continuous curve, token-grid normalized via DiT patch_size)
- Add hf_factor, lf_factor, transition parameters for fine control
- Add schedule parameter (flat/linear/cosine) for timestep decay
- Protect near-DC frequencies (r_norm < 1.0) from dc_preserve
  to prevent brightness/color shift
- Fix DC handling: step 1+ always preserves full DC
- Support 5D video latents

Rename Core node to V3 (node_id=DiversityBoostCoreV3).
Preserve old node as Legacy (node_id=DiversityBoostCore) for
backward compatibility.

Remove experimental DCW and Smart Patch nodes (superseded by V3).

Aggressive defaults tuned for strong diversity:
  strength=2.0, clamp=0.5, hf=1.0, lf=0.3, trans=2.0, sched=linear
2026-04-25 04:31:06 +08:00
facok 724f5fa153 Add V3: HF attenuation + DCT composition push for composition diversity
Experimentally validated combined mechanism:
1. Butterworth LPF erases HF spatial anchoring (composition sketch)
2. Random 4x4 DCT field applied after blur redistributes latent energy

Push runs after cleanup in single post-cfg hook — ensures signal survives.
Defaults: strength=0.5, n_periods=2, noise_type=pink.
2026-04-16 17:08:02 +08:00
facok 1f69b5a4cf Add dc_preserve parameter to control DC amplitude retention
DC (image mean brightness/color) was previously hardcoded to 1.0
(fully preserved). Testing showed dc_preserve=0 (let model rebuild
brightness freely) produces better quality. New parameter allows
tuning between 0 (attenuate DC with HF) and 1 (fully preserve).
Default 0.
2026-04-14 18:18:06 +08:00
facok b27dafac62 Use elliptical Butterworth mask for aspect-ratio independence
Circular mask with cutoff = n/max(H,W) under-counts bins along the
shorter axis of non-square images. Elliptical normalization computes
r_norm = sqrt((ky/n)^2 + (kx/n)^2) so the mask depends only on
integer cycle counts, not on H or W. n_periods=2 now covers exactly
14 bins (>0.1) at any resolution and any aspect ratio.
2026-04-14 08:23:13 +08:00
facok 4b99468127 Fix inaccurate summary in DiversityBoost vs Dummy Token comparison
Remove claim of "precise spatial surgery" and "not affecting appearance"
— DiversityBoost also relies on random noise phase. Reword to emphasize
frequency-domain precision and mathematical safety bounds vs indirect
token-level perturbation.
2026-04-14 06:27:55 +08:00
facok 439118fe5c Add DiversityBoost vs Dummy Token comparison to READMEs
Bilingual comparison table explaining the fundamental difference:
frequency-domain phase surgery (direct, bounded, safe) vs padding
token perturbation (indirect, random, no guarantees).
2026-04-14 06:25:34 +08:00
facok a12fe59d0a Replace freq_cutoff with resolution-independent n_periods parameter
freq_cutoff=0.005 produced zero effective bins at 512x512 (min
non-DC frequency 0.0156 >> 0.005 cutoff). New n_periods param
computes cutoff = n_periods / max(H,W) at runtime, guaranteeing
consistent composition-scale coverage at any resolution.

Also adds bilingual README (English + Chinese) and per-batch-item
diagnostics in logging.
2026-04-14 05:41:53 +08:00
facok 634e6c199f Tune defaults and simplify node interface
- Lower freq_cutoff default from 0.02 to 0.005 (most conservative)
- Fix max_rotation default mismatch (1.57 → 1.5708 = π/2)
- Hide hf_preserve from UI, hardcode at 0.0 (optimal setting)
- Gate logging block behind isEnabledFor(INFO) to avoid GPU syncs
- Remove redundant .float() in energy compensation (already float32)
2026-04-14 04:36:32 +08:00
facok 951bfa6526 Initial release: frequency-domain composition diversity for distilled models
Injects seed-dependent low-frequency phase from initial noise into the
model's denoised prediction at step 0 via post-CFG hook.  Different seeds
produce different compositions instead of identical layouts.

Key features:
- Slerp phase rotation with shared rotation field (zero color artifacts)
- 6th-order Butterworth LPF (steep composition/object frequency separation)
- Per-bin tanh rotation budget (decouples diversity from tail risk)
- High-frequency attenuation (prevents frequency shearing on distilled models)
- Optional energy compensation
- LTXAV video format compatible
2026-04-14 04:12:53 +08:00