{"id":22218249,"url":"https://github.com/lucafoscili/comfyui-lf","last_synced_at":"2025-07-27T14:32:38.312Z","repository":{"id":253779900,"uuid":"844291372","full_name":"lucafoscili/comfyui-lf","owner":"lucafoscili","description":"Custom nodes with a touch of extra UX ✨ History for primitives, JSON manipulation, logic switches with visual feedback, LLM chat, analytics nodes, CivitAI metadata fetching... and more!","archived":false,"fork":false,"pushed_at":"2024-10-29T22:19:10.000Z","size":272083,"stargazers_count":31,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-30T00:43:20.819Z","etag":null,"topics":["comfyui","comfyui-nodes","javascript","python","sass","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucafoscili.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-19T00:07:36.000Z","updated_at":"2024-10-29T22:18:58.000Z","dependencies_parsed_at":"2024-08-19T13:54:44.762Z","dependency_job_id":"76dd12c6-65db-4649-96fe-eadaf3226724","html_url":"https://github.com/lucafoscili/comfyui-lf","commit_stats":null,"previous_names":["lucafoscili/comfyui-lf"],"tags_count":80,"template":false,"template_full_name":null,"purl":"pkg:github/lucafoscili/comfyui-lf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucafoscili%2Fcomfyui-lf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucafoscili%2Fcomfyui-lf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucafoscili%2Fcomfyui-lf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucafoscili%2Fcomfyui-lf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucafoscili","download_url":"https://codeload.github.com/lucafoscili/comfyui-lf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucafoscili%2Fcomfyui-lf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267370615,"owners_count":24076458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comfyui","comfyui-nodes","javascript","python","sass","typescript"],"created_at":"2024-12-02T22:19:54.633Z","updated_at":"2025-07-27T14:32:33.292Z","avatar_url":"https://github.com/lucafoscili.png","language":"JavaScript","funding_links":[],"categories":["All Workflows Sorted by GitHub Stars"],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 --\u003e\n# LF Nodes for ComfyUI\n\n\u003cdiv align=\"center\"\u003e\n\n![LF Nodes](https://img.shields.io/badge/dynamic/json?logo=python\u0026logoColor=black\u0026labelColor=white\u0026color=black\u0026label=Nodes\u0026query=nodes\u0026url=https://raw.githubusercontent.com/lucafoscili/comfyui-lf/master/count.json)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![LFNodes](https://github.com/lucafoscili/comfyui-lf/blob/780ac30dd51350ba4ec7d5e0a5af39edd350b61d/docs/images/LFNodes.png \"LF Nodes logo\")\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![GitHub last commit](https://img.shields.io/github/last-commit/lucafoscili/comfyui-lf?logo=github\u0026logoColor=black\u0026labelColor=white\u0026color=black)\n\n\u003c/div\u003e\n\n## Overview\n\nA suite of custom nodes for [ComfyUI](https://github.com/comfyanonymous/ComfyUI) aimed at enhancing user experience with more interactive and visually engaging widgets.\n\nWhether you're after quality-of-life improvements or specific functionalities, this collection has something for everyone.\n\nMost UI elements used by the widgets come from the  [Ketchup Lite web components library](https://github.com/lucafoscili/ketchup-lite).\n\n![LoRA tester workflow](https://github.com/lucafoscili/comfyui-lf/blob/0b438784ecce5bb2a3bde66cf3029d91ced61911/docs/images/Screenshot%202024-11-01%20204059.png \"Screenshot taken from the LoRA tester workflow\")\n\n## What kind of nodes does it offer?\n\nThat's a tough one—the nodes span quite a few categories. Here's a quick breakdown:\n\n- **Analytics nodes**: Visualize and track data, like checkpoint/LoRA usage or image histograms.\n- **Configuration nodes**: Manage CivitAI metadata, and control the suite via the Control Panel.\n- **Image manipulation nodes**: Tools to manipulate images, such as filter and resize nodes.\n- **IO Operations nodes**: Load and save files to/from the file system.\n- **JSON nodes**: Tools to manipulate and display JSON data.\n- **LLM nodes**: Interface with locally running LLMs, like the Messenger node, which also manages characters.\n- **Logic nodes**: Control flow using simple switches.\n- **Primitive nodes**: Work with primitive data types, offering features like history.\n- **Seed generation nodes**: Generate seeds for complex workflows.\n- **Selector nodes**: Resource selection widgets with metadata display for models.\n  \n![CICD](https://github.com/lucafoscili/comfyui-lf/blob/0b438784ecce5bb2a3bde66cf3029d91ced61911/docs/images/Screenshot%202024-11-01%20195600.png \"Screenshot taken from the C.I. workflow\")\n\n## Table of Contents\n\n- [LF Nodes for ComfyUI](#lf-nodes-for-comfyui)\n  - [Overview](#overview)\n  - [What kind of nodes does it offer?](#what-kind-of-nodes-does-it-offer)\n  - [Table of Contents](#table-of-contents)\n  - [Analytics nodes (`analytics.py`)](#analytics-nodes-analyticspy)\n    - [ImageHistogram](#imagehistogram)\n    - [KeywordCounter](#keywordcounter)\n    - [UpdateUsageStatistics](#updateusagestatistics)\n    - [UsageStatistics](#usagestatistics)\n  - [Configuration nodes (`configuration.py`)](#configuration-nodes-configurationpy)\n    - [CivitAIMetadataSetup](#civitaimetadatasetup)\n    - [ControlPanel](#controlpanel)\n    - [LoadLoraTags](#loadloratags)\n    - [Lora2Prompt](#lora2prompt)\n    - [LoraTag2Prompt](#loratag2prompt)\n    - [Notify](#notify)\n  - [Image manipulation nodes (`image.py`)](#image-manipulation-nodes-imagepy)\n    - [BlurImages](#blurimages)\n    - [ClarityEffect](#clarityeffect)\n    - [MultipleImageResizeForWeb](#multipleimageresizeforweb)\n    - [ResizeImageByEdge](#resizeimagebyedge)\n    - [ResizeImageToDimension](#resizeimagetodimension)\n    - [ResizeImageToSquare](#resizeimagetosquare)\n  - [IO Operations nodes (`io.py`)](#io-operations-nodes-iopy)\n    - [LoadFileOnce](#loadfileonce)\n    - [LoadImages](#loadimages)\n    - [LoadMetadata](#loadmetadata)\n    - [SaveImageForCivitAI](#saveimageforcivitai)\n    - [SaveJSON](#savejson)\n  - [JSON nodes (`json.py`)](#json-nodes-jsonpy)\n    - [DisplayJSON](#displayjson)\n    - [GetRandomKeyFromJSON](#getrandomkeyfromjson)\n    - [GetValueFromJSON](#getvaluefromjson)\n    - [ImageListFromJSON](#imagelistfromjson)\n    - [KeywordToggleFromJSON](#keywordtogglefromjson)\n    - [LoadLocalJSON](#loadlocaljson)\n    - [SetValueInJSON](#setvalueinjson)\n    - [ShuffleJSONKeys](#shufflejsonkeys)\n    - [SortJSONKeys](#sortjsonkeys)\n    - [StringToJSON](#stringtojson)\n    - [WriteJSON](#writejson)\n  - [Large Language Model nodes (`llm.py`)](#large-language-model-nodes-llmpy)\n    - [CharacterImpersonator](#characterimpersonator)\n    - [ImageClassifier](#imageclassifier)\n    - [LLMChat](#llmchat)\n    - [LLMMessenger](#llmmessenger)\n  - [Logic nodes (`logic.py`)](#logic-nodes-logicpy)\n    - [MathOperation](#mathoperation)\n    - [ResolutionSwitcher](#resolutionswitcher)\n    - [SwitchFloat](#switchfloat)\n    - [SwitchImage](#switchimage)\n    - [SwitchInteger](#switchinteger)\n    - [SwitchJSON](#switchjson)\n    - [SwitchString](#switchstring)\n  - [Primitive nodes (`primitives.py`)](#primitive-nodes-primitivespy)\n    - [Boolean](#boolean)\n    - [DisplayBoolean](#displayboolean)\n    - [DisplayFloat](#displayfloat)\n    - [DisplayInteger](#displayinteger)\n    - [DisplayPrimitiveAsJSON](#displayprimitiveasjson)\n    - [DisplayString](#displaystring)\n    - [Extractor](#extractor)\n    - [Float](#float)\n    - [Integer](#integer)\n    - [RandomBoolean](#randomboolean)\n    - [Something2Number](#something2number)\n    - [Something2String](#something2string)\n    - [String](#string)\n    - [WallOfText](#walloftext)\n  - [Seed generation nodes (`seeds.py`)](#seed-generation-nodes-seedspy)\n    - [SequentialSeedsGenerator](#sequentialseedsgenerator)\n    - [UrandomSeedGenerator](#urandomseedgenerator)\n  - [Selector nodes (`selectors.py`)](#selector-nodes-selectorspy)\n    - [CheckpointSelector](#checkpointselector)\n    - [EmbeddingSelector](#embeddingselector)\n    - [LoraSelector](#loraselector)\n    - [LoraAndEmbeddingSelector](#loraandembeddingselector)\n    - [SamplerSelector](#samplerselector)\n    - [SchedulerSelector](#schedulerselector)\n    - [UpscaleModelSelector](#upscalemodelselector)\n    - [VAESelector](#vaeselector)\n  - [Installation](#installation)\n    - [Using ComfyUI Manager](#using-comfyui-manager)\n    - [Manual](#manual)\n  - [Notes](#notes)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Analytics nodes (`analytics.py`)\n\n### ImageHistogram\n\nDisplays a widget that plots the RGB channels of a photo in tensor format on a line chart.\n![ImageHistogram](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/ImageHistogram.png \"Screenshot of RGB histogram plotted by the node\")\n\n### KeywordCounter\n\nCounts the number of each keyword in a prompt and displays a bar chart showing their distribution, a chip-shaped widget will also allow to copy one or more keywords in the clipboard.\n![KeywordCounter](https://github.com/lucafoscili/comfyui-lf/blob/20764344d55b6e361af11d14298fc826b37eae2d/docs/images/KeywordCounter.png \"Keywords displayed with a widget for copying them\")\n\n### UpdateUsageStatistics\n\nKeep tracks of the resources used by saving datasets in the input folder of ComfyUI. The datasets will be plotted on area/scatter charts inside the twin node UsageStatistics.\n![UpdateUsageStatistics](https://github.com/lucafoscili/comfyui-lf/blob/de49b4964ecc55c32438cc829928d90b9b5a8346/docs/images/UpdateUsageStatistics.png \"Keeps track of resources' usage\")\n\n### UsageStatistics\n\nDisplays datasets tracking the usage of resources saved with the UpdateUsageStatistics node.\n![UsageStatistics](https://github.com/lucafoscili/comfyui-lf/blob/72d54488d179be2f345b84f526956c730f191663/docs/images/UsageStatistics.png \"Plots the usage of resources\")\n\n## Configuration nodes (`configuration.py`)\n\n### CivitAIMetadataSetup\n\nAllows to setup and generate [CivitAI](https://civitai.com)-compatible metadata information usable in the node SaveImageForCivitAI.\n![CivitAIMetadataSetup](https://github.com/lucafoscili/comfyui-lf/blob/273b908521957c51c655be8203efc4819bcf1e81/docs/images/CivitAIMetadataSetup.png \"The metadata string will be displayed below the settings\")\n\n### ControlPanel\n\nUtilities to debug nodes and to change the theme of Ketchup Lite webcomponents.\n![ControlPanel](https://github.com/lucafoscili/comfyui-lf/blob/6d4cf455b031a8ffae96ba322689dd3853004495/docs/images/ControlPanel.png \"Utilities included in the control panel\")\n\n### LoadLoraTags\n\nLoRA models are loaded in tag format, with a status widget displayed at the bottom indicating the loading progress.\n![LoadLoraTags](https://github.com/lucafoscili/comfyui-lf/blob/947e736fd6505b9de5b89a5a85ef86d528eae644/docs/images/LoadLoraTags.png \"Loaded LoRA tags\")\n\n### Lora2Prompt\n\nConverts a prompt and LoRAs to a formatted string.\n![Lora2Prompt](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/Lora2Prompt.png \"Screenshot showing how Lora2Prompt converts LoRA and prompts to strings\")\n\n### LoraTag2Prompt\n\nProcesses a LoRA tag to extract keywords and count them. This node is useful for preparing prompts based on LoRA file names.\n![LoraTag2Prompt](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/LoraTag2Prompt.png \"Interface of LoraTag2Prompt node splitting LoRA tags to extract keywords\")\n\n### Notify\n\nTriggers a browser notification when executed. Optionally, when clicked, it can queue a new prompt or focus the workflow's tab.\n![Notify](https://github.com/lucafoscili/comfyui-lf/blob/8f648bf3e9380bb410125d3e04a71baaf7d99ccf/docs/images/Notify.png \"Simple notification example\")\n\n## Image manipulation nodes (`image.py`)\n\n### BlurImages\n\nApplies the gaussian blur filter to a list of images and edits the filename of each image by adding the '_Blur' suffix.\n![Blurimages](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/BlurImages.png \"Screenshot of the list of images processed with Gaussian blur\")\n\n### ClarityEffect\n\nApplies a filter mimicking the clarity effect of Lightroom and Camera Raw.\n![ClarityEffect](https://github.com/lucafoscili/comfyui-lf/blob/6b74811c1b96259cca53cb96882fc1f9f55e5337/docs/images/ClarityEffect.png \"Enhanced clarity\")\n\n### MultipleImageResizeForWeb\n\nThe node takes a list of images as input and generates eight additional images, each resized to common web resolutions (256px, 320px, 512px, 640px, 1024px, 1280px, 2048px, 2560px) along the longest edge.\n![MultipleImageResizeForWeb](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/MultipleImageResizeForWeb.png \"Batch resize GUI showing multiple common web resolutions\")\n\n### ResizeImageByEdge\n\nResizes one or more images in tensor format's longest or shortest edge to the specified size.\n![ResizeImageByEdge](https://github.com/lucafoscili/comfyui-lf/blob/9ff43a168d56a4ba7174f0a69365d6226686e26e/docs/images/ResizeImageByEdge.png \"Interface of image resizing node showing edge selection\")\n\n### ResizeImageToDimension\n\nResizes an image to the longest dimension and then crops it/pads it to fit the canvas.\n![ResizeImageToDimension](https://github.com/lucafoscili/comfyui-lf/blob/84e5b7c3fe90ec17ef4902738102dc45e963d1b2/docs/images/ResizeImageToDimension.png \"Image resized and cropped/padded\")\n\n### ResizeImageToSquare\n\nResizes one or more images in tensor format to fit a square (by cropping when the image is rectangular).\n![ResizeImageToSquare](https://github.com/lucafoscili/comfyui-lf/blob/f146784989b4511a10dfc5e4be1eeb5fa1d93ae1/docs/images/ResizeImageToSquare.png \"Interface of image resizing node to square\")\n\n## IO Operations nodes (`io.py`)\n\n### LoadFileOnce\n\nLoads a file from a directory and then saves the name to the history. Files present in the history are skipped.\n![LoadFileOnce](https://github.com/lucafoscili/comfyui-lf/blob/713db4caae57bf6ac9c4b14633bc21734667c42a/docs/images/LoadFileOnce.png \"Load the content of the directory only once\")\n\n### LoadImages\n\nNode used to load multiple images from the disk given a directory. Optionally, it can fetch images from subdirectories.\n![LoadImages](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/LoadImages.png \"Node interface showing disk-based image loading with optional subdirectory fetching\")\n\n### LoadMetadata\n\nEnables uploading files to the input directory of ComfyUI, then on the workflow's execution the metadata will be extracted from the files included in the uploading process.\n![LoadMetadata](https://github.com/lucafoscili/comfyui-lf/blob/273b908521957c51c655be8203efc4819bcf1e81/docs/images/LoadMetadata.png \"Uploaded files with their metadata.\")\n\n### SaveImageForCivitAI\n\nSaves images with [CivitAI](https://civitai.com)-compatible metadata generated by the node CivitAIMetadataSetup.\n![SaveImageForCivitAI](https://github.com/lucafoscili/comfyui-lf/blob/273b908521957c51c655be8203efc4819bcf1e81/docs/images/SaveImageForCivitAI.png \"Images will be displayed as Base64 encoded previews.\")\n\n### SaveJSON\n\nSaves a JSON file at the specified path.\n![SaveJSON](https://github.com/lucafoscili/comfyui-lf/blob/b21290182b780330c9d35d6dac0a617237311e4c/docs/images/SaveJSON.png \"SaveJSON node.\")\n\n## JSON nodes (`json.py`)\n\n### DisplayJSON\n\nDisplays JSON data with a handy button to copy the content.\n![DisplayJSON](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/DisplayJSON.png \"Interface helping to visualize JSON and copy data\")\n\n### GetRandomKeyFromJSON\n\nExtracts a random key from a given JSON object. This can be used to introduce variability or select random elements from JSON data.\n![GetRandomKeyFromJSON](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/GetRandomKeyFromJSON.png \"Node UI to randomly extract keys from a JSON object\")\n\n### GetValueFromJSON\n\nExtracts a specific value from a JSON object based on a provided key. This node supports extracting various types of values including JSON objects, strings, numbers, integers, floats, and booleans.\n![GetValueFromJSON](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/GetValueFromJSON.png \"Interface displaying node to retrieve specific JSON values\")\n\n### ImageListFromJSON\n\nCreates a list of images with the number set by the number of keys inside the input JSON. It also outputs the list of keys themselves.\n![ImageListFromJSON](https://github.com/lucafoscili/comfyui-lf/blob/89937003edcebb4941e18af64eee08941bf9e5db/docs/images/ImageListFromJSON.png \"Node UI to randomly extract keys from a JSON object\")\n\n### KeywordToggleFromJSON\n\nAllows the selection of keywords received from a Ketchup Lite compatible JSON dataset. Values are refreshed every time the input changes.\n![KeywordToggleFromJSON](https://github.com/lucafoscili/comfyui-lf/blob/f146784989b4511a10dfc5e4be1eeb5fa1d93ae1/docs/images/KeywordToggleFromJSON.png \"Keywords toggled with a chip set\")\n\n### LoadLocalJSON\n\nLoads JSON data from a local file specified by a URL. This node is useful for importing static JSON configurations or datasets directly into ComfyUI workflows.\n![LoadLocalJSON](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/LoadLocalJSON.png \"Interface showing local JSON load functionality\")\n\n### SetValueInJSON\n\nSets a new key or updates an existing one with a new value.\n![SetValueInJSON](https://github.com/lucafoscili/comfyui-lf/blob/460888f68f9568b05d390add9733dc480ee0950f/docs/images/SetValueInJSON.png \"JSON updated with the new value\")\n\n### ShuffleJSONKeys\n\nSorts the keys at root level of a JSON, returning the sorted object. Optionally it can also sort the input JSON in place without making a copy of it.\n![ShuffleJSONKeys](https://github.com/lucafoscili/comfyui-lf/blob/87801285fbe09db887633a6c984983b78a9146ff/docs/images/ShuffleJSONKeys.png \"JSON keys shuffled\")\n\n### SortJSONKeys\n\nSorts the keys at root level of a JSON, returning the sorted object. Optionally it can also sort the input JSON in place without making a copy of it.\n![SortJSONKeys](https://github.com/lucafoscili/comfyui-lf/blob/87801285fbe09db887633a6c984983b78a9146ff/docs/images/SortJSONKeys.png \"JSON sorted\")\n\n### StringToJSON\n\nConverts a string to a JSON object.\n![StringToJSON](https://github.com/lucafoscili/comfyui-lf/blob/460888f68f9568b05d390add9733dc480ee0950f/docs/images/StringToJSON.png \"JSON output from a string\")\n\n### WriteJSON\n\nA simple text area that lets the user input a JSON file which will be validated when the workflow is queued. Each 2500ms the text is formatted, if there is an error it will be displayed in the title of the textarea (visible on mouseover).\n\n![WriteJSON](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/WriteJSON.png \"Text area for direct JSON input and validation\")\n\n## Large Language Model nodes (`llm.py`)\n\n### CharacterImpersonator\n\nUtilizes a large language model to generate text responses as if coming from a character described by a provided biography. This node can be used for creative writing, role-playing scenarios, or generating dynamic content based on character traits.\n![CharacterImpersonator](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/CharacterImpersonator.png \"Sample interaction simulating character impersonation based on a biography\")\n\n### ImageClassifier\n\nUtilizes a large language model to generate descriptions of images portraying characters.\n![ImageClassifier](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/ImageClassifier.png \"Example classification output describing an image character\")\n\n### LLMChat\n\nReal-time chat with an LLM model served through Koboldcpp (\u003chttp://localhost:5001\u003e).\nIt's possible to select the last messages as an output, sending them to the next node.\n![LLMChat](https://github.com/lucafoscili/comfyui-lf/blob/69181cfe1c3b2062a40035e8b59cece8e8688483/docs/images/LLMChat.png \"Example of LLM chat\")\n\n### LLMMessenger\n\nA user interface capable of loading characters through a Ketchup Lite-compatible JSON and then connects to your local Koboldcpp instance (\u003chttp://localhost:5001\u003e).\nThe location, outfit and timeframe options are included in the system prompt to give more context to the LLM.\nTogether with the biography, they define the identity of the LLM.\n![LLMMessenger](https://github.com/lucafoscili/comfyui-lf/blob/fd52deb44d199e222833fbc159628aceeac48ab9/docs/images/LLMMessenger.png \"Example of chat with Freya\")\n\n## Logic nodes (`logic.py`)\n\n### MathOperation\n\nPerforms mathematical operations involving up to four variables.\n![MathOperation](https://github.com/lucafoscili/comfyui-lf/blob/0dd555212e2a7bdd9f38cf1ef96ab4bf474594d8/docs/images/MathOperation.png \"Result logged as a markdown-formatted text\")\n\n### ResolutionSwitcher\n\nSelects a random resolution between portrait and landscape orientations. The chances for landscape to occur can be set with a percentage.\n![ResolutionSwitcher](https://github.com/lucafoscili/comfyui-lf/blob/5882f6809e687b4296719e376db34482dd8fd840/docs/images/ResolutionSwitcher.png \"Resolution was set to landscape\")\n\n### SwitchFloat\n\nReturns one of two float values depending on a boolean condition.\n![SwitchFloat](https://github.com/lucafoscili/comfyui-lf/blob/e2d71390d90b44841cf2080afcfd3869793de573/docs/images/SwitchFloat.png \"Choose between two float values based on a boolean condition\")\n\n### SwitchImage\n\nReturns one of two images in tensor format based on a boolean condition.\n![SwitchImage](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/SwitchImage.png \"Switch between two images in tensor format based on a boolean condition\")\n\n### SwitchInteger\n\nReturns one of two integer values depending on a boolean condition.\n![SwitchInteger](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/SwitchInteger.png \"Choose between two integer values based on a boolean condition\")\n\n### SwitchJSON\n\nReturns one of two JSON objects depending on a boolean condition.\n![SwitchJSON](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/SwitchJSON.png \"Conditionally select between two JSON objects using a boolean condition\")\n\n### SwitchString\n\nReturns one of two string values based on a boolean condition.\n![SwitchString](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/SwitchString.png \"Dynamically choose between two string values based on a boolean condition.\")\n\n## Primitive nodes (`primitives.py`)\n\n### Boolean\n\nUsed to select a boolean. It keeps record of old values, displaying a clickable list below the widget.\n![Boolean](https://github.com/lucafoscili/comfyui-lf/blob/7deb085a3649ec873435cb092308c4e7a01cefe9/docs/images/Boolean.png \"Boolean node with history\")\n\n### DisplayBoolean\n\nDisplays the value of a boolean in a widget.\n![DisplayBoolean](https://github.com/lucafoscili/comfyui-lf/blob/8f37015be9e81511fd159e59a468e12a251f54ef/docs/images/DisplayBoolean.png \"Boolean value displayed\")\n\n### DisplayFloat\n\nDisplays the value of a float in a widget.\n![DisplayFloat](https://github.com/lucafoscili/comfyui-lf/blob/8f37015be9e81511fd159e59a468e12a251f54ef/docs/images/DisplayFloat.png \"Float value displayed\")\n\n### DisplayInteger\n\nDisplays the value of a integer in a widget.\n![DisplayInteger](https://github.com/lucafoscili/comfyui-lf/blob/8f37015be9e81511fd159e59a468e12a251f54ef/docs/images/DisplayInteger.png \"Integer value displayed\")\n\n### DisplayPrimitiveAsJSON\n\nDisplays different primitive values as a JSON output or directly in-widget through a tree-like view.\n![DisplayPrimitiveAsJSON](https://github.com/lucafoscili/comfyui-lf/blob/e2d71390d90b44841cf2080afcfd3869793de573/docs/images/DisplayPrimitiveAsJSON.png \"Primitive values displayed as JSON\")\n\n### DisplayString\n\nDisplays the value of a string in a widget.\n![DisplayString](https://github.com/lucafoscili/comfyui-lf/blob/8f37015be9e81511fd159e59a468e12a251f54ef/docs/images/DisplayString.png \"String value displayed\")\n\n### Extractor\n\nExtracts text enclosed by a starting and ending delimiter.\n![Extractor](https://github.com/lucafoscili/comfyui-lf/blob/713db4caae57bf6ac9c4b14633bc21734667c42a/docs/images/Extractor.png \"Extraction\")\n\n### Float\n\nUsed to select a float. It keeps record of old values, displaying a clickable list below the widget.\n![Float](https://github.com/lucafoscili/comfyui-lf/blob/7deb085a3649ec873435cb092308c4e7a01cefe9/docs/images/Float.png \"Float node with history\")\n\n### Integer\n\nUsed to select an integer. It keeps record of old values, displaying a clickable list below the widget.\n![Integer](https://github.com/lucafoscili/comfyui-lf/blob/460888f68f9568b05d390add9733dc480ee0950f/docs/images/Integer.png \"Integer node with history\")\n\n### RandomBoolean\n\nOutputs False or True depending on the chances specified by the percentage widget. 0 always false, 100 always true.\n![RandomBoolean](https://github.com/lucafoscili/comfyui-lf/blob/d45405d1e87b73b6bf7f42f8827aecf1ababc582/docs/images/RandomBoolean.png \"20% chance to return True\")\n\n### Something2Number\n\nConverts multiple inputs to integers and floats, handling nested structures and mixed types. If multiple numbers are sent to the node, they are summed.\n![Something2Number](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/Something2Number.png \"Interface example of how inputs are converted to numbers\")\n\n### Something2String\n\nConverts multiple inputs to strings, handling nested structures and mixed types.\n![Something2String](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/Something2String.png \"Example of results where various structures are converted to strings\")\n\n### String\n\nUsed to select a string. It keeps record of old prompts, displaying a clickable list below the textarea.\n![String](https://github.com/lucafoscili/comfyui-lf/blob/22813956c616ec89b97b53411a0fc77dedef747b/docs/images/String.png \"String node with history\")\n\n### WallOfText\n\nConcatenates up to 10 strings, with the optional toggle to shuffle the order of concatenation.\n![WallOfText](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/WallOfText.png \"Output example of concatenated text sequences\")\n\n## Seed generation nodes (`seeds.py`)\n\n### SequentialSeedsGenerator\n\nGenerates a series of unique seeds based on a global seed value. This node is useful for creating reproducible random sequences in workflows.\n![SequentialSeedsGenerator](https://github.com/lucafoscili/comfyui-lf/blob/6d3c7e0ef3806a9e7755ec2878bc9dcfefac46a0/docs/images/SequentialSeedGenerator.png \"Visualization of the generated seed series for sequences\")\n\n### UrandomSeedGenerator\n\nGenerates up to 20 different seeds through the use of the Python urandom function which leverages CPU generated entropy for increased randomness.\n![UrandomSeedGenerator](https://github.com/lucafoscili/comfyui-lf/blob/7deb085a3649ec873435cb092308c4e7a01cefe9/docs/images/UrandomSeedGenerator.png \"Random seeds with history enabled\")\n\n## Selector nodes (`selectors.py`)\n\n### CheckpointSelector\n\nUsed to select a checkpoint. It's possible to fetch additional data from CivitAI or by loading the related cover inside the checkpoints folder.\n![CheckpointSelector](https://github.com/lucafoscili/comfyui-lf/blob/f317945c6794d119cb3b51a0b55ee20609b1f5a4/docs/images/CheckpointSelector.png \"Checkpoints additional info\")\n\n### EmbeddingSelector\n\nUsed to select an embedding. It's possible to fetch additional data from CivitAI or by loading the related cover inside the embeddings folder.\n![EmbeddingSelector](https://github.com/lucafoscili/comfyui-lf/blob/8393783e3cb4dcb486be37ca0c79985e9dd28447/docs/images/EmbeddingSelector.png \"Embedding additional info\")\n\n### LoraSelector\n\nUsed to select a LoRA. It's possible to fetch additional data from CivitAI or by loading the related cover inside the loras folder.\n![LoraSelector](https://github.com/lucafoscili/comfyui-lf/blob/865badc13204cef0af28da1f285dc4433ae495c7/docs/images/LoraSelector.png \"LoRA additional info\")\n\n### LoraAndEmbeddingSelector\n\nUsing a LoRA name as pilot, it also selects its related embedding (it must have the same name). Useful for models trained with pivotal training.\n![LoraAndEmbeddingSelector](https://github.com/lucafoscili/comfyui-lf/blob/84c0e46686c39fb521dc6d4ae46396ae002d390d/docs/images/LoraAndEmbeddingSelector.png \"LoRA and related embedding\")\n\n### SamplerSelector\n\nUsed to select a sampler, the history widget allows for a quick swap between the most used samplers.\n![SamplerSelector](https://github.com/lucafoscili/comfyui-lf/blob/e704d1c6602217387498472ebacf284e8204080b/docs/images/SamplerSelector.png \"Sampler selector\")\n\n### SchedulerSelector\n\nUsed to select a scheduler, the history widget allows for a quick swap between the most used schedulers.\n![SchedulerSelector](https://github.com/lucafoscili/comfyui-lf/blob/e704d1c6602217387498472ebacf284e8204080b/docs/images/SchedulerSelector.png \"Scheduler selector\")\n\n### UpscaleModelSelector\n\nUsed to select an upscale model, the history widget allows for a quick swap between the most used upscale models.\n![UpscaleModelSelector](https://github.com/lucafoscili/comfyui-lf/blob/de49b4964ecc55c32438cc829928d90b9b5a8346/docs/images/UpscaleModelSelector.png \"Upscale model selector\")\n\n### VAESelector\n\nUsed to select a VAE, the history widget allows for a quick swap between the most used VAEs.\n![VAESelector](https://github.com/lucafoscili/comfyui-lf/blob/de49b4964ecc55c32438cc829928d90b9b5a8346/docs/images/VAESelector.png \"VAE selector\")\n\n## Installation\n\n### Using ComfyUI Manager\n\n- Open ComfyUI Manager.\n- Search LF Nodes.\n- Install the node suite and restart ComfyUI.\n\n### Manual\n\n- Go to the `ComfyUI/custom_nodes` folder.\n- Open a terminal.\n- Copy and paste this command `git clone https://github.com/lucafoscili/comfyui-lf.git`.\n\n## Notes\n\nThe LLM nodes are designed to work with [Koboldcpp](https://github.com/LostRuins/koboldcpp/tree/v1.73).\nThe model used in the workflows samples is [UCLA-AGI/Llama-3-Instruct-8B-SPPO-Iter3](https://huggingface.co/UCLA-AGI/Llama-3-Instruct-8B-SPPO-Iter3) with [ChaoticNeutrals/LLaVA-Llama-3-8B-mmproj-Updated](https://huggingface.co/ChaoticNeutrals/LLaVA-Llama-3-8B-mmproj-Updated).\n\n## Contributing\n\nContributions to this repository are welcome, feel free to submit pull requests or open issues for discussion!\nTo setup the environment clone this repository, then from the root open a terminal and run the command\n\n`pip install -r requirements.txt`\n\nThis will install all the required dependencies for the Python back-end.\n\n`npm run setup`\n\nThis command will install all the frontend dependencies.\nNote that the repository includes the compiled files directly to allow Comfy to load them, dependencies are only needed for actual development.\n\n`npm run build`\n\nThis command will compile all the frontend sources and generate/refresh the actual web directory.\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucafoscili%2Fcomfyui-lf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucafoscili%2Fcomfyui-lf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucafoscili%2Fcomfyui-lf/lists"}