ComfyUI  >  Nodes  >  ComfyQR

ComfyUI Extension: ComfyQR

Repo Name

ComfyQR

Author
coreyryanhanson (Account age: 3065 days)
Nodes
View all nodes (4)
Latest Updated
8/9/2024
Github Stars
0.1K

How to Install ComfyQR

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

ComfyQR Description

ComfyQR is an extension for ComfyUI that enables QR code generation, offering nodes for creating basic QR images and advanced QR masking techniques, enhancing workflow versatility.

ComfyQR Introduction

ComfyQR is an extension designed to help AI artists create dynamic QR code images directly within the ComfyUI environment. This tool simplifies the process of generating QR codes by providing a set of nodes that can be used to create intricate QR patterns without the need to leave the web interface. Whether you're looking to embed QR codes into your artwork or generate unique QR designs, ComfyQR offers a streamlined solution.

The primary focus of ComfyQR is on pattern creation, making it easier for artists to integrate QR codes into their generative art projects. Additionally, for those who need to ensure the scannability of their QR codes, the companion project ComfyQR-scanning-nodes (https://gitlab.com/sofuego-comfy-nodes/ComfyQR-scanning-nodes) provides more advanced tools for QR code validation.

How ComfyQR Works

ComfyQR operates by providing nodes within ComfyUI that allow you to generate and manipulate QR codes. Think of these nodes as building blocks that you can connect to create complex QR patterns. Each node has specific inputs and outputs that you can customize to fit your needs.

For example, you can input the text you want to encode, choose the size and color of the QR code, and even select different shapes for the QR modules (the small squares that make up the QR code). The nodes then process this information and generate a QR code that you can use in your artwork.

ComfyQR Features

QR Code and QR Code (Split)

These nodes generate dynamically sized QR codes based on the length of the text, module size, and error correction level. The QR Code node is ideal for simple workflows, while the QR Code (Split) node is better for advanced pipelines, providing additional outputs for different QR code layers.

Inputs

  • protocol: Adds a prefix to the text to represent the internet protocol (e.g., "http://", "https://").
  • text: The text to encode in the QR code.
  • module_size: The pixel width of the smallest unit of the QR code.
  • max_image_size: The maximum size of the resulting QR code.
  • fill_hexcolor: The color of the QR modules in hexadecimal format.
  • back_hexcolor: The background color around the QR modules in hexadecimal format.
  • error_correction: The level of error correction (Low, Medium, Quartile, High).
  • border: The border size around the QR code.
  • module_drawer: The shape of the QR code modules (e.g., square, circle).

Outputs

  • QR_CODE: The generated QR code.
  • MODULE_LAYER: The QR code with the background color filling in the function patterns.
  • FINDER_LAYER: The isolated finder patterns over the background color.
  • FINDER_MASK: A mask that isolates the locations of the finder patterns.
  • QR_VERSION: The version of the QR code based on text length and error correction level.
  • IMAGE_SIZE: The pixel width of the resulting QR code.

QR Code (Conformed to Image Size)

This node generates a QR code fixed to specific output dimensions through image resampling.

Inputs

  • protocol: Adds a prefix to the text to represent the internet protocol.
  • text: The text to encode in the QR code.
  • image_size: The pixel dimensions to conform the QR code to.
  • fill_hexcolor: The color of the QR modules in hexadecimal format.
  • back_hexcolor: The background color around the QR modules in hexadecimal format.
  • error_correction: The level of error correction.
  • border: The border size around the QR code.
  • resampling: The resampling algorithm to use when rescaling the QR code (e.g., Bicubic, Bilinear).

Outputs

  • QR_CODE: The generated QR code.
  • QR_VERSION: The version of the QR code based on text length and error correction level.

Mask QR Errors

This node analyzes the differences between a modified QR code and the original, creating a mask of the estimated errors. This is useful for ensuring the scannability of QR codes.

Inputs

  • source_qr: The original QR code.
  • modified_qr: The modified QR code to evaluate.
  • module_size: The size of each QR module in pixels.
  • grayscale_method: The method to convert RGB to grayscale (mean, luminance).
  • aggregate_method: How to aggregate pixels within each module (mean).
  • evaluate: Which part of the QR to examine (full_qr, module_pattern, finder_pattern).
  • error_difficulty: The threshold for error detection.
  • inverted_pattern: Indicates if the QR code has inverted colors.
  • gamma: Influences the grayscale conversion formula.

Outputs

  • QR_ERROR_MASK: A mask highlighting the locations of modules with errors.
  • PERCENT_ERROR: The percentage of modules with errors.
  • CORRELATION: The Pearson correlation coefficient between the source and modified QR codes.
  • RMSE: The root mean squared error between the source and modified QR codes.

ComfyQR Models

ComfyQR does not have different models but offers various nodes with customizable settings to generate QR codes. Each node can be tailored to produce different styles and sizes of QR codes, allowing for a high degree of flexibility in your projects.

Troubleshooting ComfyQR

Common Issues and Solutions

  1. QR Code Not Scanning:
  • Ensure the error correction level is set appropriately.
  • Check that the module size is not too small.
  • Verify that the fill and background colors have sufficient contrast.
  1. Image Size Exceeds Maximum Limit:
  • Adjust the module_size or max_image_size inputs.
  • Reduce the length of the text being encoded.
  1. Color Issues:
  • Make sure the hex color values are correctly formatted.
  • Use colors that provide a clear distinction between the QR modules and the background.

Frequently Asked Questions

  • How do I change the shape of the QR modules?
  • Use the module_drawer input to select different shapes like square, circle, or rounded.
  • What is the best error correction level to use?
  • It depends on the complexity of your design. Higher error correction levels (Quartile, High) provide better scannability but result in larger QR codes.

Learn More about ComfyQR

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

  • ComfyQR GitLab Repository (https://gitlab.com/sofuego-comfy-nodes/ComfyQR)
  • ComfyQR Scanning Nodes (https://gitlab.com/sofuego-comfy-nodes/ComfyQR-scanning-nodes) Explore the examples directory in the repository for workflow examples and inspiration. You can also find metadata in the example generations folder to see how different settings affect the final output.

By leveraging these resources, you can enhance your understanding of ComfyQR and create stunning generative QR art with ease.

ComfyQR 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.