Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-TextureAlchemy > Emission Mask Generator

ComfyUI Node: Emission Mask Generator

Class Name

EmissionMaskGenerator

Category
Texture Alchemist/Materials
Author
amtarr (Account age: 1521days)
Extension
ComfyUI-TextureAlchemy
Latest Updated
2026-04-22
Github Stars
0.07K

How to Install ComfyUI-TextureAlchemy

Install this extension via the ComfyUI Manager by searching for ComfyUI-TextureAlchemy
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-TextureAlchemy in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Emission Mask Generator Description

Creates emission images from bright or color-matched regions, or generates colored noise patterns.

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; avoid 0.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, choose brightness_threshold, and adjust threshold until the intended areas remain. Keep the value below 1.0.
  • To select a distinctive colored element, choose color_select and enter its approximate color as six-digit hexadecimal RGB. Start with threshold at its 0.7 default, then lower it for a narrower match; keep it above 0.0.
  • To create an emission image without a source, choose procedural and set width and height for the size you need. Adjust pattern_scale for finer or broader variation, and change seed to explore different arrangements.
  • Start with strength at 1.0 and increase it gradually. Because output values are capped at 1.0, a high setting may make distinct bright areas look equally bright.
  • Use #FFFFFF for an uncolored procedural pattern or another valid six-digit color for a tinted one. In color_select mode, 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_color receive a low or zero selection value. A threshold that is too small can exclude nearly everything.
  • Solution: Check that emission_color resembles the color in your image, then gradually raise threshold while keeping it above 0.0.

Brightness selection produces a black or unexpectedly sparse image

  • Explanation: Pixels at or below threshold become black. A high threshold may exclude most of the source.
  • Solution: Lower threshold until the desired bright areas appear, and confirm that strength is greater than 0.0.

Requested image-based mode produces a noise pattern

  • Explanation: When source_image is absent, both image-based modes take the procedural branch.
  • Solution: Connect an image to source_image, or choose procedural if you intended to generate a pattern.

ValueError: invalid literal for int() with base 16

  • Explanation: The node could not parse part of emission_color as a hexadecimal color value.
  • Solution: Enter a valid six-digit RGB value such as #FF6600 or FF6600.

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 IMAGE from your image workflow, and ensure it has RGB channels.

RuntimeError: ... out of memory

  • Explanation: A large procedural width and height can 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: strength set to 0.0 makes every mode’s output black. An image-based selection can also be black when no pixels meet its criteria.
  • Solution: Set strength above 0.0, then adjust threshold for the selected mode.

Output has flat, clipped bright areas

  • Explanation: The node limits final values to 1.0. Raising strength can push different bright values to the same maximum.
  • Solution: Lower strength to preserve more variation between bright areas.

Invalid or undefined values at a threshold endpoint

  • Explanation: brightness_threshold divides by 1.0 - threshold, which reaches zero at 1.0. color_select divides by threshold, which reaches zero at 0.0.
  • Solution: Use a brightness threshold below 1.0 or a color-selection threshold above 0.0, as appropriate.

Emission Mask Generator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-TextureAlchemy
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Emission Mask Generator