Skip to content

Commit

Permalink
version 1.71.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Suzie1 committed Jan 16, 2024
1 parent 4a00245 commit 3cc6852
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Patch_Notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 🧩 Comfyroll Studio - Patch Notes

## v1.71.1 Jan 16, 2024
- fix for issue 101 CR Select Font
- fix for issue 103 CR Overlay Transparent Image

## v1.71 Jan 15, 2024
- changed string outputs to any_type on text util nodes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Co-authored by Suzie1 and RockOfFire

Current version: 1.71
Current version: 1.71.1

# Wiki

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from .node_mappings import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS

print("------------------------------------------")
print("\033[34mComfyroll Studio v1.71 : \033[92m 170 Nodes Loaded\033[0m")
print("\033[34mComfyroll Studio v1.71.1 : \033[92m 170 Nodes Loaded\033[0m")
print("------------------------------------------")
print("** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md")
print("** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki")
Expand Down
2 changes: 1 addition & 1 deletion nodes/nodes_graphics_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def overlay_image(self, back_image, overlay_image,
# Scale overlay image
overlay_width, overlay_height = overlay_image.size
new_size = (int(overlay_width * overlay_scale_factor), int(overlay_height * overlay_scale_factor))
overlay_image = overlay_image.resize(new_size, Image.ANTIALIAS)
overlay_image = overlay_image.resize(new_size, Image.Resampling.LANCZOS)

# Calculate centered position relative to the center of the background image
center_x = back_image.width // 2
Expand Down
16 changes: 12 additions & 4 deletions nodes/nodes_graphics_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import numpy as np
import torch
import os
import os
import platform
from PIL import Image, ImageDraw, ImageOps, ImageFont
from ..categories import icons
from ..config import color_mapping, COLORS
Expand Down Expand Up @@ -453,9 +454,16 @@ def __init__(self):

@classmethod
def INPUT_TYPES(cls):

system_root = os.environ.get('SystemRoot')
font_dir = os.path.join(system_root, 'Fonts')

if platform.system() == "Windows":
system_root = os.environ.get("SystemRoot")
font_dir = os.path.join(system_root, "Fonts") if system_root else None
# Default debian-based Linux & MacOS font dirs
elif platform.system() == "Linux":
font_dir = "/usr/share/fonts/truetype"
elif platform.system() == "Darwin":
font_dir = "/System/Library/Fonts"

file_list = [f for f in os.listdir(font_dir) if os.path.isfile(os.path.join(font_dir, f)) and f.lower().endswith(".ttf")]

return {"required": {
Expand Down
1 change: 1 addition & 0 deletions nodes/nodes_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def make_list(self, source_folder, start_index, max_rows, folder_path="C:\Window
return None
else:
pass

# Ensure start_index is within the bounds of the list
start_index = max(0, min(start_index, len(file_list) - 1))

Expand Down
176 changes: 176 additions & 0 deletions workflows/Graphics/Text/CR_Select_Font_demo1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"last_node_id": 4,
"last_link_id": 2,
"nodes": [
{
"id": 4,
"type": "PreviewImage",
"pos": [
1230,
480
],
"size": [
210,
250
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 2
}
],
"properties": {
"Node name for S&R": "PreviewImage",
"ttNbgOverride": {
"color": "#222",
"bgcolor": "#000",
"groupcolor": "#444"
}
},
"color": "#222",
"bgcolor": "#000"
},
{
"id": 3,
"type": "CR Draw Text",
"pos": [
790,
480
],
"size": [
400,
480
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "font_name",
"type": "COMBO",
"link": 1,
"widget": {
"name": "font_name"
}
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
2
],
"shape": 3,
"slot_index": 0
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Draw Text",
"ttNbgOverride": {
"color": "#222",
"bgcolor": "#000",
"groupcolor": "#444"
}
},
"widgets_values": [
512,
512,
"text",
"AlumniSansCollegiateOne-Regular.ttf",
50,
"white",
"custom",
"center",
"center",
0,
0,
0,
0,
0,
"text center",
"#000000",
"#000000"
],
"color": "#222",
"bgcolor": "#000"
},
{
"id": 1,
"type": "CR Select Font",
"pos": [
499,
479
],
"size": [
230,
80
],
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "font_name",
"type": "*",
"links": [
1
],
"shape": 3,
"slot_index": 0
},
{
"name": "show_help",
"type": "STRING",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "CR Select Font",
"ttNbgOverride": {
"color": "#222",
"bgcolor": "#000",
"groupcolor": "#444"
}
},
"widgets_values": [
"consolab.ttf"
],
"color": "#222",
"bgcolor": "#000"
}
],
"links": [
[
1,
1,
0,
3,
0,
"COMBO"
],
[
2,
3,
0,
4,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}

0 comments on commit 3cc6852

Please sign in to comment.