Git Product home page Git Product logo

ultools-comfyui's Introduction

🖼️ ULTools for ComfyUI

Collection of tools supporting txt2img generation in ComfyUI and other tasks.

Nodes Included

SaveImgAdv

Forked from Kaharos94 / https://github.com/Kaharos94/ComfyUI-Saveaswebp and heavily adapted

Custom node to save a picture as webp or jpeg file in ComfyUI.

Workflow saving and loading is supported by drag and drop or the standard load dialogue.

Basic support of automatic1111 compatible prompt embedding and CivitAI model hashes.

EXIF keywords can be stored in image meta data (goes nice with WD14 tagger).

📔 Description

This adds a custom node to save a picture as png, webp or jpeg file and also adds a script to Comfy to drag and drop generated images into the UI to load the workflow.

PNG images saved by default from the node shipped with ComfyUI are lossless, thus occupy more space compared to lossy formats.

⚙️ Options - Filename prefix: just the same as in the original Save Image node of ComfyUI. Supports creation of subfolders by adding slashes - Format: png / webp / jpeg - Compression: used to set the quality for webp/jpeg, does nothing for png - Lossy / lossless (lossless supported for webp and jpeg formats only) - Calc model hashes: whether to calculate hashes of models used in the workflow and append the in CivitAI compatible format (AutoV2), so images are mapped to their resources automatically when uploaded - Add automatic1111 meta: whether to add a1111 compatible meta information to the image exif data, so that CivitAI may parse the prompt etc. - Keywords: can be used to store keywords in EXIF field ImageIFD/XPKeywords, e.g. when using WD14 tagger (right click node, then click "convert keywords to input" to be able to plug them in)

The compression slider is a bit misleading: In lossless mode, it only affects the "effort" taken to compress where 100 is the smallest possible size and 1 is the biggest possible size, it's a tradeoff for saving speed.

In lossy mode, that's the other way around, where 100 is the biggest possible size with the least compression and 1 is the smallest possible size with maximum compression.

On default it's set to lossy with a compression of 90.

The workflow JSON is embedded in the EXIF metadata of the images, sections ImageIFD/Make for prompt and ImageIFD/ImageDescription for workflow meta. Automatic1111 prompt info is added at field ExifIFD/UserComment.

🚧 Known issues

Import of Webpfiles breaks if import a workflow that has }Prompt:{ in a Node that has dynamic wildcards disabled.

Images posted on CivitAI created with this node will only use the automatic1111 compatibility metadata, not the workflow as with original ComfyUI PNG files.

The filename index appending only works with an additional underscore being added.

Prompt compatibility with automatic1111 is basic and hacky and will surely break for more advanced workflows. It works reasonably well for basic txt2img and tries doing its best to get a full positive and negative prompt by traversing through the node graph.

CivitAI model hashes require the SHA256sum of the models used in the workflow which takes a while to calculate on the first execution. Hashes are cached in a simple JSON file.

CLIPTextEncodeWithStats

Alternative for the regular CLIPTextEncode node which gathers statistics of the number of tokens and batches created from the input text.

Due to limitations of the litegraph backend the node currently is not capable of a live calculation of the statistics. Instead, upon execution of the prompt, the node calculates the statistic and creates an image of the table which can be viewed in the PreviewImage node. It is an ugly solution but at least it works.

OpenPoseEditorAdv

Forked from space-nuko / https://github.com/space-nuko/ComfyUI-OpenPose-Editor with bugs fixed and heavily adapted

A port of the openpose-editor extension for stable-diffusion-webui

The editor automatically generates a mask for each pose. Useful for specific conditioning per pose.

Usage

Import the image > OpenPoseEditorAdv node, add a new pose and use it like you would a LoadImage node. Each change you make to poses will be saved to the input folder of ComfyUI.

Example Workflow

Screenshot

SolidMaskAdv

A simple addition to the regular solid mask node to support circular mask generation.

It has a switch for the type of the mask to be generated (rectangle or ellipsis).

🖥️ Installation

In your terminal/console, navigate to your ComfyUI custom nodes directory and clone this repo:

git clone https://github.com/jkrauss82/ultools-comfyui.git

Change into the directory:

cd ultools-comfyui

Activate your python virtual environment and install the requirements (piexif, pandas, numpy):

pip install -r requirements.txt

Restart ComfyUI.

⚠️ Warning

Hobby project, if you encounter bugs or problems feel free to create an issue, but not guarantee that it will be taken care of right away or ever.

ultools-comfyui's People

Contributors

jkrauss82 avatar comfy-pr-bot avatar

Stargazers

 avatar oputocom avatar  avatar Eric Rollei avatar ainewsto avatar

Watchers

 avatar Rahul Y Gupta avatar

ultools-comfyui's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.