Emission Mask Generator:
EmissionMaskGenerator creates an image that marks areas intended to emit light. It can derive those areas from the brightest parts of an existing image, pick areas close to a chosen color, or generate a colored noise pattern without an image. This gives you a way to prepare glowing details such as lights, screens, or magical effects. The result is an emission image, not a rendered glow effect; how it looks when used in a material depends on the rest of your workflow.
Emission Mask Generator Input Parameters:
mode
Required. Choose one of brightness_threshold, color_select, or procedural. brightness_threshold uses the bright areas of a connected image; color_select uses areas whose colors are close to a chosen color; and procedural generates a new noise-based pattern. If you choose either image-based mode without connecting source_image, the node generates a procedural pattern instead.
strength
Required float controlling emission intensity. The default is 1.0, the minimum is 0.0, and the maximum is 10.0, in steps of 0.1. Higher values make retained areas brighter, but the final image is limited to values between 0.0 and 1.0, so sufficiently high values lose brightness detail. At 0.0, the result is black.
source_image
Optional IMAGE used by brightness_threshold and color_select. In those modes, the node uses the image’s colors as the basis of the result, reducing or retaining them according to the selected areas. There is no numeric minimum, maximum, or default value. This input is ignored in procedural mode; when it is absent in either image-based mode, the node follows the procedural branch.
threshold
Optional float whose meaning depends on the mode. The default is 0.7, the minimum is 0.0, and the maximum is 1.0, in steps of 0.01. In brightness_threshold mode, image areas at or below this brightness become black, while brighter areas are increasingly retained; raising it selects fewer areas. In color_select mode, it sets how close a pixel’s color must be to emission_color; raising it allows a wider range of colors. It has no effect in procedural mode. Avoid 1.0 for brightness selection because the calculation divides by ``1.0
- threshold
; avoid0.0for color selection because that calculation divides bythreshold``.
emission_color
Optional color string with a default of #FFFFFF. Supply a six-digit hexadecimal RGB color, such as #FF6600; the leading # may be omitted. In color_select mode, this is the color the node looks for, but matching areas retain their colors from source_image rather than being repainted with this value. In procedural mode, it colors the generated pattern. It has no effect in brightness_threshold mode. There is no numeric minimum or maximum.
width
Optional integer setting the procedural image’s width in pixels. The default is 512, the minimum is 64, and the maximum is 8192, in steps of 64. It does not resize a connected source_image in either image-based mode. Larger procedural images require more memory and processing.
height
Optional integer setting the procedural image’s height in pixels. The default is 512, the minimum is 64, and the maximum is 8192, in steps of 64. It does not resize a connected source_image in either image-based mode. Larger procedural images require more memory and processing.
pattern_scale
Optional float controlling the scale of variation in the procedural pattern. The default is 20.0, the minimum is 1.0, and the maximum is 100.0, in steps of 1.0. Higher values produce broader, smoother variations; lower values produce finer variation. It has no effect when an image-based mode has a connected source_image.
seed
Optional integer used to initialize the random values for the procedural pattern. The default is 0, the minimum is 0, and the maximum is 18446744073709551615. Reusing a seed is intended to reproduce a pattern, while changing it produces a different arrangement. It has no effect when an image-based mode has a connected source_image. The node also sets PyTorch’s random seed during procedural generation, which may affect other operations sharing that random-number generator.
Emission Mask Generator Output Parameters:
emission
An IMAGE containing the generated emission result, with values clamped between 0.0 and 1.0. In brightness_threshold mode, it retains the brighter parts of source_image in their original colors and darkens the rest. In color_select mode, it retains image colors according to their similarity to emission_color. In procedural mode, it contains a newly generated colored noise pattern at the requested dimensions. The output is a color image, not necessarily a single-channel black-and-white mask or a visible bloom effect.
Emission Mask Generator Usage Tips:
- To isolate lamps or bright screen details in an image, connect it to
source_image, choosebrightness_threshold, and adjustthresholduntil the intended areas remain. Keep the value below1.0. - To select a distinctive colored element, choose
color_selectand enter its approximate color as six-digit hexadecimal RGB. Start withthresholdat its0.7default, then lower it for a narrower match; keep it above0.0. - To create an emission image without a source, choose
proceduraland setwidthandheightfor the size you need. Adjustpattern_scalefor finer or broader variation, and changeseedto explore different arrangements. - Start with
strengthat1.0and increase it gradually. Because output values are capped at1.0, a high setting may make distinct bright areas look equally bright. - Use
#FFFFFFfor an uncolored procedural pattern or another valid six-digit color for a tinted one. Incolor_selectmode, remember that this setting selects colors rather than recoloring the output.
Emission Mask Generator Common Errors and Solutions:
Color selection produces little or no visible emission
- Explanation: Pixels far from
emission_colorreceive a low or zero selection value. Athresholdthat is too small can exclude nearly everything. - Solution: Check that
emission_colorresembles the color in your image, then gradually raisethresholdwhile keeping it above0.0.
Brightness selection produces a black or unexpectedly sparse image
- Explanation: Pixels at or below
thresholdbecome black. A high threshold may exclude most of the source. - Solution: Lower
thresholduntil the desired bright areas appear, and confirm thatstrengthis greater than0.0.
Requested image-based mode produces a noise pattern
- Explanation: When
source_imageis absent, both image-based modes take the procedural branch. - Solution: Connect an image to
source_image, or chooseproceduralif you intended to generate a pattern.
ValueError: invalid literal for int() with base 16
- Explanation: The node could not parse part of
emission_coloras a hexadecimal color value. - Solution: Enter a valid six-digit RGB value such as
#FF6600orFF6600.
Color selection fails with a tensor size mismatch
- Explanation: The color-selection calculation expects the source image to have three color channels. An image with an incompatible channel layout cannot be compared with the three-channel target color.
- Solution: Convert the source to a standard three-channel RGB image before connecting it.
Brightness selection fails with an index or dimension error
- Explanation: The brightness calculation expects a batched image with height, width, and at least three color channels.
- Solution: Connect a valid
IMAGEfrom your image workflow, and ensure it has RGB channels.
RuntimeError: ... out of memory
- Explanation: A large procedural
widthandheightcan exhaust available memory while the node creates and enlarges several noise grids. - Solution: Reduce the procedural dimensions and try again.
Output is fully black
- Explanation:
strengthset to0.0makes every mode’s output black. An image-based selection can also be black when no pixels meet its criteria. - Solution: Set
strengthabove0.0, then adjustthresholdfor the selected mode.
Output has flat, clipped bright areas
- Explanation: The node limits final values to
1.0. Raisingstrengthcan push different bright values to the same maximum. - Solution: Lower
strengthto preserve more variation between bright areas.
Invalid or undefined values at a threshold endpoint
- Explanation:
brightness_thresholddivides by1.0 - threshold, which reaches zero at1.0.color_selectdivides bythreshold, which reaches zero at0.0. - Solution: Use a brightness threshold below
1.0or a color-selection threshold above0.0, as appropriate.
