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.
39 lines
995 B
Python
39 lines
995 B
Python
"""ComfyUI-DiversityBoost: Restore composition diversity for distilled diffusion models.
|
|
|
|
HF attenuation + DCT composition push at step 0. Training-free, single-step,
|
|
zero model modification.
|
|
"""
|
|
|
|
from comfy_api.latest import ComfyExtension, io
|
|
from .core_node import DiversityBoostCore
|
|
|
|
|
|
class DiversityBoostExtension(ComfyExtension):
|
|
"""V3 ComfyExtension providing the DiversityBoost node."""
|
|
|
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
|
return [DiversityBoostCore]
|
|
|
|
|
|
async def comfy_entrypoint() -> DiversityBoostExtension:
|
|
"""V3 async entry point called by ComfyUI on startup."""
|
|
return DiversityBoostExtension()
|
|
|
|
|
|
# V2 backward compatibility
|
|
NODE_CLASS_MAPPINGS = {
|
|
"DiversityBoostCore": DiversityBoostCore,
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"DiversityBoostCore": "Diversity Boost",
|
|
}
|
|
|
|
__all__ = [
|
|
"NODE_CLASS_MAPPINGS",
|
|
"NODE_DISPLAY_NAME_MAPPINGS",
|
|
"DiversityBoostExtension",
|
|
"comfy_entrypoint",
|
|
"DiversityBoostCore",
|
|
]
|