ComfyUI  >  Nodes  >  ComfyQR >  QR Code

ComfyUI Node: QR Code

Class Name

comfy-qr-by-module-size

Category
ComfyQR
Author
coreyryanhanson (Account age: 3065 days)
Extension
ComfyQR
Latest Updated
6/14/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

QR Code Description

Generate precise QR codes with specific module sizes for visual consistency and readability control.

QR Code:

The comfy-qr-by-module-size node is designed to generate QR codes with a specific module size, allowing for precise control over the dimensions and appearance of the QR code. This node is particularly useful for creating QR codes that need to fit within specific size constraints or for applications where the visual consistency of the QR code modules is crucial. By adjusting the module size, you can ensure that the QR code maintains its readability and aesthetic quality, even when scaled to different sizes. This node leverages advanced methods to process and convert images into QR codes, ensuring high accuracy and quality.

QR Code Input Parameters:

protocol

This parameter specifies the protocol to be used in the QR code. Options include "Http", "Https", and "None", with the default being "Https". Choosing the correct protocol ensures that the QR code directs to the intended type of URL.

text

This is the content that will be encoded into the QR code. It accepts a string input and supports multiline text. The text you provide here will be the information that the QR code represents, such as a URL, contact information, or any other data.

module_size

This parameter defines the size of each module (the smallest unit) in the QR code. It is an integer value with a default of 16, a minimum of 1, and a maximum of 64. Adjusting the module size can help in fitting the QR code into specific dimensions or improving its readability.

max_image_size

This parameter sets the maximum size of the generated QR code image. It is an integer value with a default of 512, a minimum of 64, and a maximum of 4096. This ensures that the QR code does not exceed the desired dimensions, which is useful for maintaining layout consistency in various applications.

fill_hexcolor

This parameter specifies the color of the QR code modules in hexadecimal format. The default value is "#000000" (black). Changing this color can help in matching the QR code with the design aesthetics of your project.

back_hexcolor

This parameter defines the background color of the QR code in hexadecimal format. The default value is "#FFFFFF" (white). Adjusting the background color can enhance the visual appeal and contrast of the QR code.

error_correction

This parameter sets the level of error correction for the QR code. Options include "Low", "Medium", "Quartile", and "High", with the default being "High". Higher error correction levels make the QR code more robust to damage or distortion but can increase the size of the QR code.

border

This parameter determines the width of the border around the QR code. It is an integer value with a default of 1, a minimum of 0, and a maximum of 100. Adjusting the border size can help in ensuring that the QR code is easily scannable and visually distinct from surrounding elements.

QR Code Output Parameters:

QR_ERROR_MASK

This output provides a mask indicating the areas of the QR code that contain errors. It is useful for identifying and correcting issues in the QR code generation process.

PERCENT_ERROR

This output gives the percentage of errors in the QR code. It helps in assessing the quality and reliability of the generated QR code.

CORRELATION

This output measures the correlation between the source and modified QR codes. A higher correlation indicates that the generated QR code closely matches the intended design.

RMSE

This output provides the Root Mean Square Error (RMSE) between the source and modified QR codes. It is a measure of the differences between the values predicted by the model and the actual values, helping to quantify the accuracy of the QR code generation.

QR Code Usage Tips:

  • Ensure that the module_size is set to a value that allows the QR code to fit within your desired dimensions without losing readability.
  • Use the error_correction parameter to increase the robustness of the QR code, especially if it will be printed on materials that might get damaged.
  • Adjust the fill_hexcolor and back_hexcolor to match the design aesthetics of your project, ensuring good contrast for better scannability.
  • Set the max_image_size to prevent the QR code from exceeding the layout constraints of your application.

QR Code Common Errors and Solutions:

"Source QR dimensions are {width} x {height}. They must be a perfect square."

  • Explanation: This error occurs when the dimensions of the source QR code are not equal, which is required for a valid QR code.
  • Solution: Ensure that the source image or data used to generate the QR code has equal width and height.

"QR width of {width} does not fit module_size of {module_size}. It must be perfectly divisible."

  • Explanation: This error happens when the width of the QR code is not perfectly divisible by the specified module size.
  • Solution: Adjust the module_size parameter to a value that divides the width of the QR code evenly.

"Module reshaping requires a 2 dimensional array."

  • Explanation: This error indicates that the input tensor for reshaping is not a 2D array, which is necessary for module reshaping.
  • Solution: Ensure that the input data is a 2D array before attempting to reshape it into modules.

"Currently only mean is supported for rgb to grayscale conversion."

  • Explanation: This error occurs when an unsupported method is selected for RGB to grayscale conversion.
  • Solution: Use the "mean" method for grayscale conversion to avoid this error.

QR Code Related Nodes

Go back to the extension to check out more related nodes.
ComfyQR
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.