natto-maki / ComfyUI-NegiTools

Apache License 2.0
28 stars 4 forks source link

ComfyUI-NegiTools

[!IMPORTANT] "Depth Estimation by Marigold (experimental)" module is not maintained and will be discontinued in the future; if you would like to continue using Marigold, please consider using this alternative choice. https://github.com/kijai/ComfyUI-Marigold

Installation

Update

  1. Navigate to the cloned repo e.g. custom_nodes/ComfyUI-NegiTools
  2. git pull

Features

Generator/OpenAI DALLe3

Generates an image using DALL-E3 via OpenAI API.

required: OPENAI_API_KEY.

REVISED_OUTPUT will output the prompts that DALL-E3 modified prior to generation.

screenshot_openai_dalle3

Generator/Noise Image Generator

Generate a noise image.

Each component of the output image is scaled in the range of 0.0 to 1.0.

Generator/Depth Estimation by Marigold (experimental)

Depth estimation using Marigold.

Generator/Stereo Image Generator

Generates stereo image; This custom node calls the image transformation algorithm contained in the following extension for A1111 (automatically cloned). https://github.com/thygate/stable-diffusion-webui-depthmap-script

utils/OpenAI Translate to English

Translates text written in any language into English using GPT-4. This is useful when you want to write prompts in a language other than English for input into Stable Diffusion.

It may be even more useful in combination with String Function.

required: OPENAI_API_KEY.

screenshot_openai_translate

utils/String Function

String generation using Python scripts.

Any Python script can be stored in python_code. The script will be wrapped in a function and executed, and output a string that is returned by the return statement.

a, b, c are optional input strings. They can be accessed in the script as they are with the variable names a, b, c.

Available modules: random, re, numpy (as np)

python_code example:

colors = ["red", "orange", "yellow", "green", "blue", "purple"]
return "a girl with %s hair and %s eyes wearing %s maid costume" % (
  random.choice(colors), random.choice(colors), a 
)
# got "a girl with green hair and red eyes wearing white maid costume", etc.
screenshot_string_function

[!NOTE]
The import statement and the eval() and exec() functions cannot be used in python_code field for security reasons.

[!CAUTION] This Node is capable of executing Python code and therefore has security risks. Please review the python_code contents carefully before attempting to execute a workflow received from a third party that cannot be fully trusted.

utils/Seed Generator

Generate an integer to be used as the seed value.

Although Sampler, such as KSampler, allows the user to select a random or fixed value for the seed value, if they are set to random, the values are updated after workflow is executed. This behavior making it difficult to restore the seed value after a good picture is obtained by random generation.

The "Seed Generator" node can be set to random or keep_previous, and the seed value is generated at the time of workflow execution. Therefore, you can set the Seed Generator node to random at first, and repeat the generation process, then switch to keep_previous when a good picture is obtained, and fix the seed value thereafter.

screenshot_seed_generator

utils/ImageProperties

Outputs the properties of the image. Currently only the resolution (width and height) can be output.

utils/LatentProperties

Outputs the properties of the latent image. Currently only the resolution (width and height) can be output.

utils/CompositeImages

Composite two images with alpha.

utils/OpenPoseToPointList

Detects key points on the human body using OpenPose. Results are output as a JSON string.

This node is used in combination with utils/PointListToMask to generate masks based on key points.

utils/PointListToMask

Generates a mask from the coordinate list output by utils/OpenPoseToPointList.