ComfyUI  >  Nodes  >  ComfyUI_WordCloud

ComfyUI Extension: ComfyUI_WordCloud

Repo Name

ComfyUI_WordCloud

Author
chflame163 (Account age: 445 days)
Nodes
View all nodes (3)
Latest Updated
5/25/2024
Github Stars
0.1K

How to Install ComfyUI_WordCloud

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

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

Run ComfyUI Online

ComfyUI_WordCloud Description

ComfyUI_WordCloud generates visual word clouds from text data using nodes like Word Cloud and Load Text File, enabling users to create graphical representations of word frequency and importance within a given text.

ComfyUI_WordCloud Introduction

ComfyUI_WordCloud is an extension designed to generate word cloud images within the ComfyUI environment. A word cloud is a visual representation of text data, where the size of each word indicates its frequency or importance. This extension leverages the library to create these visualizations, making it easier for AI artists to analyze and present textual information in a visually appealing manner.

With ComfyUI_WordCloud, you can create customized word clouds that highlight key terms, exclude specific words, and even shape the word cloud to fit a particular contour. This tool is particularly useful for artists who want to incorporate text-based art into their projects or need a creative way to display textual data.

How ComfyUI_WordCloud Works

At its core, ComfyUI_WordCloud works by analyzing a block of text and determining the frequency of each word. The more frequently a word appears, the larger it will be in the word cloud. This extension allows you to customize various aspects of the word cloud, such as colors, fonts, and shapes, to create a unique and visually engaging output.

Basic Principles:

  1. Text Analysis: The extension breaks down the provided text into individual words and counts their occurrences.
  2. Word Sizing: Words are sized based on their frequency, with more frequent words appearing larger.
  3. Customization: Users can customize the appearance of the word cloud by setting colors, fonts, and shapes.
  4. Output: The final word cloud is generated as an image, which can be used in various artistic projects.

ComfyUI_WordCloud Features

Word Cloud Node

The Word Cloud node is the primary feature of this extension. It allows you to generate word cloud images based on your text input. Here are the customizable options available:

  • color_ref_image: Use an input image as a reference for text color.
  • mask_image: Use an input image to define the shape of the word cloud. If the image has an alpha channel, it will be used as the contour.
  • text: The text content to be visualized in the word cloud.
  • width & height: Dimensions of the generated image. If a mask image is provided, these settings are ignored.
  • scale: Amplification factor for the final image size.
  • margin: Size of the blank edge around the word cloud.
  • font_path: Path to the font file to be used.
  • min_font_size & max_font_size: Minimum and maximum font sizes for the words.
  • relative_scaling: Controls the relative size of words in the word cloud.
  • colormap: Predefined color maps from Matplotlib for text color.
  • background_color: Background color in hexadecimal RGB format.
  • transparent_background: Option to make the background transparent.
  • prefer_horizontal: Controls the orientation of words (horizontal vs. vertical).
  • max_words: Maximum number of words to include in the word cloud.
  • repeat: Allows words to repeat if the maximum number is not reached.
  • include_numbers: Includes numbers as word elements.
  • random_state: Seed for the random number generator to ensure reproducibility.
  • stopwords: Words to exclude from the word cloud.
  • contour_width & contour_color: Width and color of the contour if a mask image is used.
  • keynote_words: Words to emphasize further.
  • keynote_weight: Weight for keynote words to control their size.

RGB Color Picker Node

This node allows you to select colors from a palette and output RGB values, making color selection more convenient.

  • mode: Output format, available in hexadecimal (HEX) and decimal (DEC).

Load Text File Node

This node loads a text file from a specified path and uses UTF-8 encoding.

  • path: Path to the .txt file.

ComfyUI_WordCloud Models

Currently, ComfyUI_WordCloud does not include different models. It relies on the word_cloud library to generate word clouds based on the provided text and customization options.

What's New with ComfyUI_WordCloud

Recent Updates:

  • Mask Output: The Word Cloud node now includes a mask output option.
  • RGB Color Picker: Added a node for easier color selection.
  • Custom Font Directory: Users can customize the font directory by editing the font_dir.ini file. This file is located in the root directory of the plugin and defaults to the Windows system font directory (C:\Windows\fonts). If the custom directory is invalid, the built-in font directory will be used.

Important Reminder:

For workflows saved with older versions, you need to reset the font:

  1. Set the font_dir.ini.
  2. Start ComfyUI and load the workflow.
  3. Reselect the font in the font_path of the WordCloud node.

Troubleshooting ComfyUI_WordCloud

Common Issues and Solutions:

  1. Font Not Displaying Correctly:
  • Ensure the font path in font_dir.ini is correct.
  • Restart ComfyUI after setting the font directory.
  1. Word Cloud Not Generating:
  • Check if the text input is correctly formatted.
  • Ensure that the mask image (if used) is properly set and has the correct dimensions.
  1. Color Issues:
  • Verify that the color_ref_image is correctly set if you are using it for color reference.
  • Ensure the colormap setting is not conflicting with the color_ref_image.

Frequently Asked Questions:

  • How do I change the font? Edit the font_dir.ini file to point to your desired font directory and restart ComfyUI.

  • Can I use custom shapes for the word cloud? Yes, you can use a mask image to define custom shapes.

Learn More about ComfyUI_WordCloud

For additional resources, tutorials, and community support, you can explore the following:

  • These resources provide valuable information and examples to help you get the most out of ComfyUI_WordCloud.

ComfyUI_WordCloud Related Nodes

RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.