20 Commits
Author SHA1 Message Date
Corey Hanson e31449c99a update pyproject.toml 2025-01-26 08:53:29 -06:00
Corey Hanson ad78464341 fix qrcode pil deprecation bug 2025-01-26 08:44:18 -06:00
Corey Hanson ae639c69c1 restore workflow to to require change to pyproject.toml 2024-07-05 00:11:16 -04:00
Corey 959dcfa062 Trigger Registry Build 2024-07-05 00:09:22 -04:00
Corey Hanson aa35c8feb0 main repo overwritten the github action ensuring change is on both 2024-07-05 00:08:22 -04:00
Corey Hanson 6b1b83b4a5 changed license in pyproject.toml to string 2024-07-04 23:55:37 -04:00
Corey Hanson 3b16771cf7 added pyproject.toml 2024-07-04 23:06:19 -04:00
Corey Hanson 29cd12358e fix typo 2024-03-17 22:12:38 -04:00
Corey Hanson 5818bdf812 shorten line lengths 2024-03-17 22:08:59 -04:00
Corey Ryan Hanson 7cb0d7de12 Merge branch 'complete/add-module-drawer' into 'main'
Add custom module drawers

See merge request sofuego-comfy-nodes/ComfyQR!3
2024-03-18 00:43:54 +00:00
Corey Ryan Hanson 7f60e01b9a Add custom module drawers 2024-03-18 00:43:54 +00:00
Corey Hanson f70b527f7c fix broken links in example png metadata 2024-03-09 13:48:32 -05:00
Corey Hanson 4f45656976 support batch operations on qr error mask 2023-10-14 22:24:40 -04:00
Corey Hanson 310f576108 fix for bug that occurs when masking torch tensors with numpy array 2023-09-14 15:00:11 -04:00
Corey Hanson 849bba41ad rename old pictures. Section off bulky upscales for easier pruning later if repo requires it 2023-08-24 21:34:27 -04:00
Corey Hanson cb7726221e update supplemental materials 2023-08-24 20:51:04 -04:00
Corey Hanson e91f331652 added luminance based grayscale conversion 2023-08-24 00:07:01 -04:00
Corey Ryan Hanson 2de40a517e Missed one name in readme 2023-08-22 03:16:42 +00:00
Corey Ryan Hanson fc2b20ad38 update links and group name to reflect name format 2023-08-22 03:15:11 +00:00
Corey Ryan Hanson ab262513df Still early enough to improve project name without being too disruptive. To whomever has managed to find this plugin sorry for breaking the link this one time. 2023-08-22 02:57:26 +00:00
29 changed files with 1696 additions and 1756 deletions
+22
View File
@@ -0,0 +1,22 @@
name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- "pyproject.toml"
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+19 -5
View File
@@ -1,12 +1,12 @@
# comfy-qr
# ComfyQR
A set of ComfyUI nodes to dynamically create QR image layers for generative QR art without the hassle of leaving the webui.
Everything in this pack is primarily focused on the creation of patterns. While the `Mask QR Errors` does some basic statistics on the differences bwtween pixels, a more definative node on determining scannability can be found in the companion project [Comfy QR Validation Nodes](https://gitlab.com/sofuego-comfy-nodes/comfy-qr-validation-nodes) which uses additional dependencies for the reading of QRs.
Everything in this pack is primarily focused on the creation of patterns. While the `Mask QR Errors` does some basic statistics on the differences between pixels, a more definative node on determining scannability can be found in the companion project [ComfyQR-scanning-nodes](https://gitlab.com/sofuego-comfy-nodes/ComfyQR-scanning-nodes) which uses additional dependencies for the reading of QRs.
This repository is managed publicly on [Gitlab](https://gitlab.com/sofuego-comfy-nodes/comfy-qr), but also mirrored on [Github](https://github.com/coreyryanhanson/comfy-qr). Please submit any [issues](https://gitlab.com/sofuego-comfy-nodes/comfy-qr/-/issues) or [pull requests](https://gitlab.com/sofuego-comfy-nodes/comfy-qr/-/merge_requests) to the gitlab repo.
This repository is managed publicly on [Gitlab](https://gitlab.com/sofuego-comfy-nodes/ComfyQR), but also mirrored on [Github](https://github.com/coreyryanhanson/ComfyQR). Please submit any [issues](https://gitlab.com/sofuego-comfy-nodes/ComfyQR/-/issues) or [pull requests](https://gitlab.com/sofuego-comfy-nodes/ComfyQR/-/merge_requests) to the gitlab repo.
![QR code with repo link](img/badgers_levels_adjusted.png)
![QR code with repo link](example_generations/main_qr_inpainted.png)
## Getting started
@@ -35,6 +35,7 @@ A dynamically sized QR code without any resampling scaled by the text length, th
* `Quartile` - 25% error correction.
* `High` - 30% error correction.
* `border` - The border size (In multiples of `module` widths)
* `module_drawer` - The shape the QR code modules should be. The default is `square`, but see [Alternate Module Drawers](#alternate-module-drawers) below for new examples.
#### Outputs
@@ -74,6 +75,7 @@ A QR code fixed to specific output dimensions through image resampling.
* `Hamming` - Hamming interpolation
* `Lanczos` - Lanczos interpolation
* `Nearest` - Nearest Neighbor interpolation
* `module_drawer` - The shape the QR code modules should be. The default is `square`, but see [Alternate Module Drawers](#alternate-module-drawers) below for new examples.
#### Outputs
@@ -99,6 +101,7 @@ A node that that will analyze the differences between a modified QR and create a
* `module_size` - The size in pixels of each QR module (the individual blocks that make up a qr code) in the provided images.
* `grayscale_method` - How to convert the RGB color channels to a single grayscale value.
* `mean` - A simple average of the RGB values.
* `luminance` - Converts colors to grayscale using a [more advanced formula](https://en.wikipedia.org/wiki/Grayscale#Colorimetric_(perceptual_luminance-preserving)_conversion_to_grayscale) to better match percieved brightness.
* `aggregate_method` - How to aggregate the many pixels that make up a QR module into a single value.
* `mean` - Within each module a simple average is taken of all constituent pixels.
* `evaluate` - Which part of the QR to examine.
@@ -107,6 +110,7 @@ A node that that will analyze the differences between a modified QR and create a
* `finder_pattern` - Ignores the modules while examining only the 3 finder patterns at the corners of the QR.
* `error_difficulty` - It is possible that while using the same reader a QR code could be easily scannable on one monitor, but not on another. The way the colors are displayed can have a major effect on unsability. By increasing this threshold, you are simulating inability to distinguish midrange pixels for both the `PERCENT_ERROR` and `QR_ERROR_MASK` outputs. It ranges from 0 to 1 where 0 only automatically fails perfect grays while 1 accepts only exactly matched modules that are perfectly black or white.
* `inverted_pattern` - If set to `True` this assumes that the QR code has inverted colors (a black background with white modules.)
* `gamma` - If using the `grayscale` method based on `luminance`, this will influence the formula by appending the gamma expansion and compression formulas before and after the color conversion. A gamma of 2.2 will use the [formula specific to srgb](qr_nodes.py#0.04045), while other gamma values will simply use the gamma amount as an exponent.
#### Outputs
@@ -125,7 +129,17 @@ And then aggressively increasing the strength of the ControlNet on only the erro
![Fixed Scan Example](example_generations/unscannable_00001_fixed_.png)
Any workflow in the example that ends with "validated" (and a few image examples) assume the installation of the [validation pack](https://gitlab.com/sofuego-comfy-nodes/comfy-qr-validation-nodes) as well.
Any workflow in the example that ends with "validated" (and a few image examples) assume the installation of the [scanning pack](https://gitlab.com/sofuego-comfy-nodes/ComfyQR-scanning-nodes) as well.
## Alternate Module Drawers
The QR generation nodes now support alternate module styles. Experiment using different ones for greater flexibility during generation.
| Square | Gapped Square | Circle | Rounded | Vertical bars | Horizontal bars |
|:---: | :---: | :---: | :---: | :---: | :---: |
| ![Example QR](/img/square.png) | ![Example QR](img/gapped_square.png) | ![Example QR](img/circle.png) | ![Example QR](img/rounded.png) | ![Example QR](img/vertical-bars.png) | ![Example QR](img/horizontal-bars.png) |
**Note** _Even unaltered non square styles will inherently register small deviations from RMSE values and possible minute deviations for correlations when using the [Mask QR Errors](#mask-qr-errors) node. When information is extracted, the `source_qr` values are rounded so that they can only be 0 or 1 (to allow alternate drawers to be used as inputs) and matched against the unrounded aggregation of the `modified_qr` values._
## Future updates
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 924 KiB

After

Width:  |  Height:  |  Size: 924 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 909 KiB

After

Width:  |  Height:  |  Size: 907 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 KiB

After

Width:  |  Height:  |  Size: 961 KiB

File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -342,7 +342,8 @@
"#DDDDDD",
"High",
1,
"Nearest"
"Nearest",
"Square"
]
}
],
@@ -440,4 +441,4 @@
"config": {},
"extra": {},
"version": 0.4
}
}
+2 -1
View File
@@ -477,7 +477,8 @@
"#000000",
"#FFFFFF",
"Medium",
1
1,
"Square"
]
}
],
@@ -524,7 +524,8 @@
"#000000",
"#FFFFFF",
"High",
1
1,
"Square"
]
},
{
+2 -1
View File
@@ -394,7 +394,8 @@
"#000000",
"#FFFFFF",
"High",
1
1,
"Square"
]
},
{
+3 -2
View File
@@ -357,7 +357,8 @@
"#000000",
"#FFFFFF",
"High",
1
1,
"Square"
]
}
],
@@ -423,4 +424,4 @@
"config": {},
"extra": {},
"version": 0.4
}
}
+3 -2
View File
@@ -70,7 +70,8 @@
"FF0",
"High",
1,
"Nearest"
"Nearest",
"Circle"
]
}
],
@@ -88,4 +89,4 @@
"config": {},
"extra": {},
"version": 0.4
}
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 59 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+16
View File
@@ -0,0 +1,16 @@
[project]
name = "comfyqr"
description = "QR generation within ComfyUI. Contains nodes suitable for workflows from generating basic QR images to techniques with advanced QR masking."
version = "0.4.1"
license = "LICENSE"
dependencies = ["qrcode >= 7.1"]
[project.urls]
Repository = "https://github.com/coreyryanhanson/ComfyQR"
# Used by Comfy Registry https://comfyregistry.org
[tool.comfy]
PublisherId = "coreyryanhanson"
DisplayName = "ComfyQR"
Icon = ""
+645 -458
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -1 +1,2 @@
qrcode >= 7.1
qrcode >= 7.1
pillow >= 9.0