HunyuanImage-3.0 SEGA:
HunyuanImage3SEGA enables spectral-energy guided attention (SEGA) for HunyuanImage-3.0 generation at resolutions larger than 1024×1024. Attention helps the model decide which parts of its internal image representation should influence one another; SEGA adjusts that process using the image’s spatial spectrum, which describes how visual information is distributed across different scales, from broad structures to finer variations. It combines a slightly weaker rescaling of rotary positional embeddings, also called RoPE, with a separate attention-temperature adjustment for each spatial frequency, calculated from the image representation at each generation step. In accessible terms, it makes high-resolution attention responsive to the evolving image’s distribution of visual information rather than relying only on fixed adjustments. Its purpose is to adapt attention behavior for larger images, not to upscale an existing image or guarantee sharper results. It has no effect at or below 1024×1024.
HunyuanImage-3.0 SEGA Input Parameters:
model
The required model input accepts a ComfyUI MODEL connection and should receive the HunyuanImage-3.0 model you intend to use for generation. The node clones the supplied model wrapper and enables SEGA in the clone’s transformer options by setting hy3_sega to True; the model implementation then uses this setting during supported high-resolution generation. This changes how the connected model is configured for subsequent sampling rather than generating an image immediately or modifying the original model connection in place. The source contains no model-family validation, so receiving a MODEL connection alone does not establish that the connected model supports this option. There is no default model, minimum, maximum, or selectable option: you must supply the model through a connection, and there are no additional strength, temperature, or resolution controls on this node.
HunyuanImage-3.0 SEGA Output Parameters:
MODEL
The MODEL output is the cloned model wrapper with SEGA enabled through its transformer options. Connect it to the model input of the sampling stage, or to the next appropriate model-processing node in your workflow, so subsequent generation uses this configuration. It represents a configured model, not an image, latent image, or numerical quality score; visible results appear only after sampling and image decoding elsewhere in your workflow. The original incoming model wrapper is not directly modified, allowing you to retain a separate unpatched connection for comparison. Although this output carries the enabled setting, the documented attention changes apply only above the supported 1024×1024 baseline and require a model implementation that recognizes the SEGA option.
HunyuanImage-3.0 SEGA Usage Tips:
- Place this node after loading your HunyuanImage-3.0 model and before sampling. Make sure the sampler receives this node’s
MODELoutput rather than a direct connection from the original model loader. - Use it for generation above 1024×1024, such as 1536×1536 if your workflow and hardware support that size. Set the generation dimensions elsewhere in your workflow; this node does not change image size and has no effect at or below 1024×1024. - Compare SEGA-enabled and unpatched generations using the same prompt, seed, dimensions, sampler, and step count. Keeping those settings consistent helps you judge the effect on your particular composition without confusing it with unrelated changes.
- Treat SEGA as an automatic adjustment rather than a manually tunable filter. The node exposes no strength slider, attention-temperature setting, or RoPE control; its frequency-dependent adjustment is derived during generation.
- Keep the original model connection available when testing. Because the node clones the model wrapper, you can route the original and patched versions into separate test runs without needing to overwrite your baseline configuration.
- Do not assume SEGA provides a speed-up or reduces memory consumption. The supplied source describes an attention adaptation for larger images; the separate HAP node is the one explicitly described as an attention speed-up.
HunyuanImage-3.0 SEGA Common Errors and Solutions:
Required input missing: model
- Explanation: This is a descriptive validation issue rather than an exact error string defined by this node. The
modelinput is required, so an unconnected input prevents normal execution. - Solution: Connect the
MODELoutput from your HunyuanImage-3.0 model loader or an appropriate preceding model-processing node tomodel, then run the workflow again.
Invalid connection type for model
- Explanation: This describes an interface mismatch rather than a custom exception in the source. The node expects a
MODELconnection; an image, latent, conditioning, or text-encoder output cannot substitute for it. - Solution: Check the output type of the node you are connecting. Use its
MODELoutput, and keep image, latent, and conditioning connections attached to their corresponding sampling inputs.
SEGA produces no apparent change
- Explanation: This is a troubleshooting symptom, not an exception message. The node explicitly has no effect at or below 1024×1024. A sampler connected to the original model instead of the patched output also will not use this node’s setting, and even correctly enabled SEGA is not guaranteed to produce an obvious improvement in every image.
- Solution: Test at a supported larger resolution, verify that the sampler receives this node’s
MODELoutput, and compare matched generations with identical settings. Evaluate several prompts rather than expecting a dramatic change in every result.
Connected model does not support SEGA
- Explanation: This is a compatibility warning, not an error string raised by the provided node. The implementation simply enables
hy3_segaand does not check the model family. An unrelated model may ignore that setting, so successful execution of this node does not prove that SEGA is active. - Solution: Use the HunyuanImage-3.0 model implementation associated with this extension. If your workflow uses a different model family, remove this patch unless that implementation explicitly documents support for the same option.
CUDA out of memory
- Explanation: This is a possible downstream sampling error, not an exception explicitly raised by this node. Generating larger images can exceed available GPU memory, and the supplied implementation does not promise that enabling SEGA will reduce those requirements.
- Solution: Reduce batch size or generation dimensions, close other GPU-intensive applications, and use memory-management options supported by your ComfyUI setup. If you reduce the resolution to 1024×1024 or below, remember that SEGA will no longer affect generation.
HunyuanImage-3.0 SEGA node is missing or unavailable
- Explanation: This is a workflow-loading or installation symptom rather than a message defined in the node class. Your installation may not have loaded the extension successfully, or its installed version may not include this node.
- Solution: Confirm that ComfyUI-HunyuanImage3 is installed and includes this node, review the ComfyUI startup log for extension-loading errors, and restart ComfyUI after installation or updates. Search for the display name
HunyuanImage-3.0 SEGAin themodel/patch/hunyuan image 3category.
