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-FuncAsTexture-CoiiNode

ComfyUI Extension: ComfyUI-FuncAsTexture-CoiiNode

Repo Name

ComfyUI-FuncAsTexture-CoiiNode

Author
coiichan (Account age: 2771 days)
Nodes
View all nodes(1)
Latest Updated
2025-06-24
Github Stars
0.0K

How to Install ComfyUI-FuncAsTexture-CoiiNode

Install this extension via the ComfyUI Manager by searching for ComfyUI-FuncAsTexture-CoiiNode
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-FuncAsTexture-CoiiNode 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

ComfyUI-FuncAsTexture-CoiiNode Description

ComfyUI-FuncAsTexture-CoiiNode processes images with custom NumPy formulas and ready-made nodes for precise blending, RGB channel edits, masks, texture sampling, and UV transformations.

ComfyUI-FuncAsTexture-CoiiNode Introduction

ComfyUI-FuncAsTexture-CoiiNode gives you a way to process images with mathematical rules inside a ComfyUI workflow. You can blend images by exact amounts, work with individual red, green, and blue channels, create masks, and build texture effects. Its main node lets you write a short NumPy formula; a collection of ready-to-use nodes provides common operations without requiring you to start with a blank formula.

The extension is useful when a blending mode does not make its calculation clear, or when you need an operation such as taking the brighter value from two images at each position. Instead of repeatedly adjusting a blend until it looks close, you can state the rule directly. For example, imga * 0.7 + imgb * 0.3 combines two images using 70% of the first and 30% of the second.

The author drew inspiration for the main node from the Custom node in the Unreal Engine Material Editor. You do not need to know Unreal Engine to use it; the connection is the idea of expressing an image effect as a calculation.

Overview of the extension

How ComfyUI-FuncAsTexture-CoiiNode Works

Think of an image as a grid of small color values. The extension applies a rule to those values and turns the result back into an image. A rule can combine two images, adjust a color channel, compare values against a threshold, or move the positions from which colors are sampled.

The main node accepts a multiline formula. In that formula, imga is the main image, while imgb and imgc are additional images you can use in calculations. You can also use number inputs named pfloat1 through pfloat3 and pint1 through pint2 to adjust a formula without rewriting it. The formula must assign its final output to result.

For example, this averages two images:

result = (imga + imgb) * 0.5

Changing the numbers changes the mix:

result = imga * 0.7 + imgb * 0.3

The first image is also split into imga_r, imga_g, and imga_b, so you can work on its red, green, and blue channels separately. The supplied makergb(r, g, b) function combines three channels into an image. This example creates a grayscale image using a different weight for each channel:

gray = 0.299 * imga_r + 0.587 * imga_g + 0.114 * imga_b
result = makergb(gray, gray, gray)

NumPy is available as np by default; you do not need to add import numpy as np to a formula. This makes functions such as np.where available for conditional effects. For instance, the following rule turns values above a threshold white and the rest black:

threshold = 0.5
result = np.where(imga > threshold, 1.0, 0.0)

The node converts the result into the image tensor format used for its output. By default, the output height and width follow imga. If imga is not connected, the default dimensions are 512 × 512. When combining images, check that their resolutions are compatible.

Main node and its inputs

ComfyUI-FuncAsTexture-CoiiNode Features

Main Formula Node

The main node is the flexible starting point for custom effects:

InputWhat it does
imgaMain image. It supplies imga_r, imga_g, and imga_b and normally determines the output size.
imgb, imgcAdditional images for comparisons, blends, and conditional effects. If either is absent, the node uses zero-filled data for that input.
pfloat1–pfloat3Optional decimal-number controls. They accept negative values and default to 0.0.
pint1–pint2Optional whole-number controls. They accept negative values and default to 0.
formulaRequired multiline calculation. Assign the image or values you want to output to result.

You can use the number controls as adjustable settings for an effect. A formula that uses pfloat1 as a blend weight, for example, can be tuned from the node input instead of edited each time. More advanced formulas can use NumPy mathematical functions, matrix calculations, and conditional expressions.

Ready-to-Use Calculation Nodes

These derived nodes provide examples of the main node’s calculations. They expose only the inputs and parameter ranges needed for their particular effect, making them simpler to use directly. You can also copy their formula text into the main node to study or adapt it.

NodeWhat it does and when it may help
SubtractionSubtracts one image from another, useful for revealing differences.
MultiplyMultiplies corresponding image values, useful for combining an image with another image or mask.
DividedDivides corresponding values of two images.
MaxKeeps the larger value at each corresponding position in two images.
MinKeeps the smaller value at each corresponding position.
DotCalculates a dot product along the last image axis, combining channel values in a different way from an ordinary blend.
DistanceCalculates the Euclidean distance between corresponding image values, useful for measuring how different they are.
PowerRaises values in imga to the exponent set by pfloat1. Changing the exponent changes how the values are distributed.
HueShiftShifts the hue of imga by the angle set with pfloat1.
PannerTranslates imga horizontally and vertically using pint1 and pint2.
OutlineShifts imga left, right, up, and down by pint1 pixels, averages those shifted images, and subtracts the original to produce an outline effect.
LerpInterpolates between imga and imgb using pfloat1 as the blend control.
ClampRestricts image values to the range set by pfloat1 and pfloat2.
CeilRounds each image value upward.
1 - xSubtracts each value in imga from one, producing an inverted-value effect.
SineApplies the sine function to each value in imga.
DDXCalculates a difference in the horizontal direction, which can help emphasize horizontal changes in an image.
Contant3Vector(Color)Creates a solid RGB color image from constant values.
if (FuncAsTexture)Compares imga with pfloat1, then selects values from imgb or imgc according to the comparison.
Chroma_Key_AlphaCreates a green-screen keying effect using an HSV green range and a softened mask.
DesaturationDesaturates imga using the mean of its three color channels.

Texture Expansion Nodes

These nodes focus on texture coordinates and transformations. UV coordinates are a way of describing where to look on a texture: instead of changing a color directly, a UV-based effect changes which position supplies that color.

NodeWhat it does
UV Coordinate GeneratorCreates a UV texture that can guide coordinate-based effects.
Texture SamplerSamples a texture according to UV coordinates, allowing a coordinate map to guide a transformation.
Inverse UV Map GeneratorAttempts to derive an inverse-transformed UV map from an input UV map. It is a beta feature and is not suitable for images with too many pixels.
RotatorRotates a texture map.

Texture expansion nodes

Troubleshooting ComfyUI-FuncAsTexture-CoiiNode

A formula does not produce the expected output

  1. Check that the formula assigns its final value to result.
  2. Check that every image or parameter name in the formula matches an available input, such as imga, pfloat1, or imga_r.
  3. Test a short formula, such as result = imga, before adding more calculations. This helps identify which step causes the problem.

A calculation using two images fails

  1. Compare the resolutions of the connected images.
  2. Make the resolutions compatible before applying an operation that combines their values.
  3. Try the calculation again with a simple formula, such as result = (imga + imgb) * 0.5.

The output size is not what you expected

Check whether imga is connected. The output normally follows its height and width; without it, the default dimensions are 512 × 512.

An unconnected image changes the result

An absent imgb or imgc is replaced with zero-filled data. Connect an image if the intended calculation depends on its colors. For example, averaging imga with an unconnected imgb will not give the same result as averaging two connected images.

A derived node is close to the effect you want, but not quite right

Use its existing controls first. If you need a different rule, copy the derived node’s formula into the main node and adjust the calculation there.

Frequently Asked Questions

Do I need to write Python to use the extension?
No. The derived nodes offer ready-to-use operations. The main formula node is available when you want a more specific effect.

Do I need to import NumPy in a formula?
No. It is already available as np.

Can I edit individual color channels?
Yes. Use imga_r, imga_g, and imga_b, then combine channels with makergb(r, g, b) when needed.

Is the Inverse UV Map Generator appropriate for large images?
The original documentation describes it as a beta feature and says it is not suitable for images with too many pixels. Start with a smaller image when exploring it.

Learn More about ComfyUI-FuncAsTexture-CoiiNode

ComfyUI-FuncAsTexture-CoiiNode Related Nodes

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.

ComfyUI-FuncAsTexture-CoiiNode detailed guide | ComfyUI