21 Commits
Author SHA1 Message Date
LEv145 acad7c4273 Merge pull request #15 from ComfyNodePRs/update-publish-yaml
Update Github Action for Publishing to Comfy Registry
2026-09-17 22:14:18 +02:00
snomiao 25889e53e3 chore(publish): update GitHub Actions workflow for node publishing
- Add permissions for writing issues
- Update action version to v1 for publish-node-action
- Add condition to run job only for specific repository owner
2025-01-21 08:43:25 +00:00
LEv145 852db490ef Update license 2024-05-30 19:54:28 +02:00
LEv145 e258287ad7 Add .idea files 2024-05-30 19:50:25 +02:00
LEv145 38c9209a98 Update pyproject.toml for comfyCLI 2024-05-30 19:50:13 +02:00
LEv145 f17d5131ab Merge pull request #12 from haohaocreates/publish
Add Github Action for Publishing to Comfy Registry
2024-05-23 01:41:21 +02:00
LEv145 47b55961f2 Merge pull request #11 from haohaocreates/pyproject
Add pyproject.toml for Custom Node Registry
2024-05-23 01:41:09 +02:00
haohaocreates ed9a2868ff chore(pyproject): Add pyproject.toml for Custom Node Registry 2024-05-22 13:54:49 -04:00
haohaocreates 70c9b30ebf chore(publish): Add Github Action for Publishing to Comfy Registry 2024-05-22 13:54:21 -04:00
LEv145 8115be4771 Merge pull request #10 from LEv145/dev
v 2.5.1
2024-02-23 01:10:21 +02:00
LEv145 6c93712961 v 2.5.1
Add support `\n` for column texts
2024-02-23 01:09:19 +02:00
LEv145 9591638263 Merge pull request #9 from kenjiqq/main
Fix padding calculation for column annotations with newlines
2024-02-23 01:04:18 +02:00
kenjiqq bb195b17e2 fix padding calculation for column annotations with newlines 2024-02-18 15:17:09 +01:00
LEv145 44365fa3ea Merge pull request #8 from LEv145/dev
v 2.5
2023-08-05 16:52:22 +02:00
LEv145 d6fc97799f Merge pull request #7 from Lightsockie/main
Allow Single-Axis Annotations
2023-08-05 16:45:37 +02:00
LEv145 8f439e074e Update logic 2023-08-05 16:37:39 +02:00
LEv145 fe2447ef6c Update logic 2023-08-05 16:35:35 +02:00
LEv145 d4e337eeb3 Move vars 2023-08-05 16:31:28 +02:00
LEv145 4548bf62a4 Update typing 2023-08-05 16:30:14 +02:00
LEv145 63ddd51d0b Update typing 2023-08-05 16:28:49 +02:00
lightsockie aefa323bab Allow Single-Axis Annotations 2023-08-04 15:04:52 -07:00
11 changed files with 140 additions and 35 deletions
+25
View File
@@ -0,0 +1,25 @@
name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"
permissions:
issues: write
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'LEv145' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@v1
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+8
View File
@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+25
View File
@@ -0,0 +1,25 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyMethodMayBeStaticInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="false" level="WARNING" enabled_by_default="false">
<option name="ignoredPackages">
<value>
<list size="10">
<item index="0" class="java.lang.String" itemvalue="pandas" />
<item index="1" class="java.lang.String" itemvalue="beautifulsoup4" />
<item index="2" class="java.lang.String" itemvalue="selenium" />
<item index="3" class="java.lang.String" itemvalue="textract" />
<item index="4" class="java.lang.String" itemvalue="SQLAlchemy" />
<item index="5" class="java.lang.String" itemvalue="psycopg2" />
<item index="6" class="java.lang.String" itemvalue="python-dotenv" />
<item index="7" class="java.lang.String" itemvalue="requests" />
<item index="8" class="java.lang.String" itemvalue="urllib3" />
<item index="9" class="java.lang.String" itemvalue="PyPDF2" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyRedundantParenthesesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
</profile>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Poetry (content_sync_server)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Poetry (content_sync_server)" project-jdk-type="Python SDK" />
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/images-grid-comfy-plugin.iml" filepath="$PROJECT_DIR$/.idea/images-grid-comfy-plugin.iml" />
</modules>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+14
View File
@@ -0,0 +1,14 @@
[project]
name = "images-grid-comfy-plugin"
description = "This tool provides a viewer node that allows for checking multiple outputs in a grid, similar to the X/Y Plot extension."
version = "2.6.0"
license = "MIT"
# Comfy UI
[project.urls]
Repository = "https://github.com/LEv145/images-grid-comfy-plugin"
[tool.comfy]
PublisherId = "lev145"
DisplayName = "images-grid-comfy-plugin"
Icon = "https://img10.joyreactor.cc/pics/comment/Anime-%D1%84%D1%8D%D0%BD%D0%B4%D0%BE%D0%BC%D1%8B-vtuber-Neuro-sama-4808746.png"
+2 -11
View File
@@ -26,12 +26,8 @@ class GridAnnotationNode(BaseNode):
font_size: int,
) -> tuple[Annotation]:
font = ImageFont.truetype(str(STATIC_PATH / "Roboto-Regular.ttf"), size=font_size)
column_texts_list = self._set_value_to_texts_list(
self._get_texts_from_string(column_texts),
)
row_texts_list = self._set_value_to_texts_list(
self._get_texts_from_string(row_texts),
)
column_texts_list = self._get_texts_from_string(column_texts)
row_texts_list = self._get_texts_from_string(row_texts)
result = Annotation(column_texts=column_texts_list, row_texts=row_texts_list, font=font)
return (result,)
@@ -42,8 +38,3 @@ class GridAnnotationNode(BaseNode):
for i in string.split(";")
if (result := i.strip()) != ""
]
def _set_value_to_texts_list(self, texts_list: list[str]) -> list[str]:
if not texts_list:
return ["None"]
return texts_list
+31 -24
View File
@@ -92,19 +92,24 @@ def _create_grid_annotation(
row_texts: list[str],
font: ImageFont.FreeTypeFont,
) -> Image.Image:
if not column_texts or not row_texts:
raise ValueError("Column text or row text is empty")
if not column_texts and not row_texts:
raise ValueError("Column text and row text is empty")
grid = grid_info.image
left_padding = int(
max(
font.getlength(splitted_text)
for raw_text in row_texts
for splitted_text in raw_text.split("\n")
left_padding = 0
top_padding = 0
if row_texts:
left_padding = int(
max(
font.getlength(splitted_text)
for raw_text in row_texts
for splitted_text in raw_text.split("\n")
)
+ font.getlength(WIDEST_LETTER)*2
)
+ font.getlength(WIDEST_LETTER)*2
)
top_padding = int(font.size * 2)
if column_texts:
top_padding = max(elem.count("\n") for elem in column_texts) * int(font.size) + int(font.size * 2)
image = Image.new(
"RGB",
@@ -116,20 +121,22 @@ def _create_grid_annotation(
draw.font = font # type: ignore
_paste_image_to_lower_left_corner(image, grid)
_draw_column_text(
draw=draw,
texts=column_texts,
grid_info=grid_info,
left_padding=left_padding,
top_padding=top_padding,
)
_draw_row_text(
draw=draw,
texts=row_texts,
grid_info=grid_info,
left_padding=left_padding,
top_padding=top_padding,
)
if column_texts:
_draw_column_text(
draw=draw,
texts=column_texts,
grid_info=grid_info,
left_padding=left_padding,
top_padding=top_padding,
)
if row_texts:
_draw_row_text(
draw=draw,
texts=row_texts,
grid_info=grid_info,
left_padding=left_padding,
top_padding=top_padding,
)
return image