Ir para o conteúdo
Node packVerificadoExterno

Krea2 Training Free Improvements

Mantenedor@iljung1106Unratednota

Perfil do pacote

Status
Verificado
Publicador
@iljung1106
Estrelas
0

README

Krea2 Training Free Improvements

Composable training-free guidance and acceleration nodes for Krea2 in ComfyUI.

Nodes

Krea2 Geometry-Aware Attention Guidance

An adaptation of Geometry-Aware Attention Guidance for Krea2's single-stream transformer. It applies alpha=1.5 Entmax and the parallel-only GAG correction to image-query -> positive-text retrieval while leaving image self-attention dense.

The paper proves GAG for explicit cross-attention. Krea2 uses joint attention, so this implementation preserves the native text-attention mass and replaces only the conditional distribution within the positive-text partition. It is a Krea2 adaptation, not official code from the paper authors.

Krea2 NAG Negative Prompt

Krea2 negative prompting based on Normalized Attention Guidance.

Krea2 Prompt Reinjection

An adaptation of Prompt Reinjection that saves Krea2's shallow text features and adds them back before deeper single-stream blocks. The defaults (origin=1, targets=2..27, weight=0.025, no anchoring) follow the official recommendation for a new MMDiT architecture.

Krea2 TaylorSeer Lite

An adaptation of the official TaylorSeer Lite HunyuanImage implementation. It periodically computes the full Krea2 output and keeps Taylor factors for that one final feature only. Forecast steps skip all 28 transformer blocks. Unlike the earlier per-block implementation, cache memory is independent of the number and hidden width of transformer blocks.

This follows the released Lite code: the cached feature is the denoiser output after Krea2's final layer, not the hidden state before it. Finite differences and forecasts use integer denoising-step distance as in equations 7-9 of the TaylorSeer paper and the official code.

Krea2 Adaptive Progressive Sampler

A Krea2-aware progressive-resolution Euler sampler. It was informed by the fixed-noise hierarchy in Fresco, but it is an independent implementation rather than a reproduction: Fresco's exact promotion schedule and mixed-resolution attention code have not been released.

The sampler makes the transition verifiable instead of generating fresh random padding. It decomposes ComfyUI's incoming seeded noise with an orthonormal 2D Haar transform, denoises the low-frequency parent at a smaller spatial size, then restores the untouched child detail coefficients at the current flow sigma. For Krea2's rectified-flow marginal this is x_sigma = sigma * noise + (1 - sigma) * clean. Each resolution uses Krea2's native dense position grid; spreading coarse tokens across the final canvas creates an out-of-distribution sparse RoPE grid and can duplicate anatomy.

Why a smaller start can still produce duplicated anatomy

A smaller latent does not automatically make a large final canvas safe. The first denoising calls establish global topology: subject count, pose, head and limb placement. Full-resolution calls performed later usually refine that topology rather than replace it.

An earlier prototype scaled the coarse token coordinates across the final canvas. For example, a half-resolution 32x32 token grid was positioned sparsely over the range of a 64x64 grid. Although only 32x32 tokens were evaluated, the transformer therefore saw an unfamiliar wide coordinate field. This can look to the model like unsupported oversized generation and produce extra heads, legs, or repeated subjects.

The current sampler does not scale or spread Krea2's position coordinates. Every resolution uses its native contiguous coordinate grid. On promotion, the sampler reconstructs the next resolution from the same seeded Haar noise hierarchy and the current clean prediction; it does

Nós neste pacote

Nós 5
  • Krea2AdaptiveProgressiveSampler
  • Krea2GeometryAwareAttentionGuidance
  • Krea2NAGNegativePrompt
  • Krea2PromptReinjection
  • Krea2TaylorSeer

Fontes

3 fontes
GitHubFonteVersão 29edd28df6f25d2f2ee821877d7700772b0d0bab
github.com/iljung1106/Krea2-Training-Free-Improvements

Verificado 25 de set.