32 Commits
Author SHA1 Message Date
MathiasandClaude Sonnet 5 1f04e10322 Add MegapixelScale node (#23)
* Add MegapixelScale node to scale width/height to a target megapixel count

Scales width and height so total pixels match the given megapixels
input while preserving the original aspect ratio.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Es1PqnGyFk9U2mngaWxgNg

* Round MegapixelScale output to nearest multiple of 8

Diffusion models generally require width/height divisible by 8, so
snap the scaled dimensions directly instead of leaving raw rounding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Es1PqnGyFk9U2mngaWxgNg

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-27 23:12:55 +02:00
Mathias 14b8d0de04 Set PublisherId to ferocit in pyproject.toml 2026-03-23 19:52:12 +01:00
Mathias 75aa3cb43f Merge pull request #1 from ComfyNodePRs/publish
Add Github Action for Publishing to Comfy Registry
2026-03-23 19:48:41 +01:00
Mathias 21a2684a04 Merge pull request #2 from ComfyNodePRs/pyproject
Add pyproject.toml for Custom Node Registry
2026-03-23 19:46:38 +01:00
Mathias 942bbc0b5f Merge pull request #22 from Ferocit/claude/review-refactoring-plan-7X70m
Add TextTemplateNode for {placeholder} prompt template substitution
2026-03-23 19:30:32 +01:00
Claude f7490d4375 Add TextTemplateNode for {placeholder} substitution (closes #21)
New node that fills a template string containing {placeholder} tokens
from up to 5 key/value pairs wired from upstream nodes. Unknown
placeholders are left intact rather than erroring, so partial templates
work during workflow development. Malformed templates (unclosed braces)
return the original string unchanged.

12 tests added covering substitution, passthrough, edge cases,
and malformed input.

https://claude.ai/code/session_01JBWyFr5shvPXUPmZkX3Nhg
2026-03-23 18:30:15 +00:00
Mathias 6650a7a287 Second refactoring round: rename files, fix trailing newline, consolidate utilities
Second refactoring round: rename files, fix trailing newline, consolidate utilities
2026-03-23 19:19:52 +01:00
Claude 529f97e87e Add module-level docstrings to all modules (closes #18)
Added one-line module docstrings to config.py, file_utils.py,
load_description_node.py, and random_line_from_text_node.py to
improve navigability and IDE support.

https://claude.ai/code/session_01JBWyFr5shvPXUPmZkX3Nhg
2026-03-23 18:18:49 +00:00
Claude b9cfc66b47 Rename feroc_node.py to random_line_from_text_node.py and update class name (closes #17)
- feroc_node.py -> random_line_from_text_node.py
- Class RandomLineFromText -> RandomLineFromTextNode (consistent with LoadDescriptionNode)
- tests/test_feroc_node.py -> tests/test_random_line_from_text_node.py
- Updated __init__.py to import RandomLineFromTextNode from the new module
- NODE_CLASS_MAPPINGS key stays "RandomLineFromText" for ComfyUI backwards compatibility

https://claude.ai/code/session_01JBWyFr5shvPXUPmZkX3Nhg
2026-03-23 18:17:34 +00:00
Claude 18a974d7d3 Remove redundant _abs_path() wrapper in LoadDescriptionNode (closes #16)
_abs_path() was a one-liner that only delegated to normalize_description_path().
Removed the wrapper and replaced all call sites with direct calls to
normalize_description_path(). Removed the now-redundant TestAbsPath test class
(covered by TestNormalizeDescriptionPath in test_file_utils.py).

https://claude.ai/code/session_01JBWyFr5shvPXUPmZkX3Nhg
2026-03-23 18:16:37 +00:00
Claude 4394861df4 Move list_all_description_files() and _ensure_example_exists() to file_utils.py (closes #15)
Both functions are file I/O operations and belong in file_utils.py alongside
the other file utilities. load_description_node.py now imports them from there.
Added tests for both functions in test_file_utils.py.

https://claude.ai/code/session_01JBWyFr5shvPXUPmZkX3Nhg
2026-03-23 18:15:44 +00:00
Claude f5d2ff56f7 Fix trailing newline in read_random_line() return value (closes #14)
read_random_line() was filtering empty lines with line.strip() but
returning lines with their original \n intact. Changed to rstrip('\n')
so callers receive clean strings without trailing newlines.
Added test to verify no trailing newline in returned value.

https://claude.ai/code/session_01JBWyFr5shvPXUPmZkX3Nhg
2026-03-23 18:14:07 +00:00
Mathias 9661733fc9 Merge pull request #13 from Ferocit/claude/review-refactoring-plan-7X70m
docs: replace placeholder name in README with fictional character example
2026-03-23 14:48:18 +01:00
Claude 426865fdb7 docs: replace placeholder name in README with fictional character example 2026-03-23 13:48:02 +00:00
Mathias 444ae9a541 Merge pull request #12 from Ferocit/claude/review-refactoring-plan-7X70m
chore: gemini.md entfernen, README korrigieren
2026-03-23 14:42:36 +01:00
Claude fc87c67367 chore: gemini.md aus Tracking entfernen, README korrigieren
- .gitignore: AI-Agent-Dateien (gemini.md, GEMINI.md, claude.md,
  CLAUDE.md, copilot-instructions.md, .cursorrules) ignorieren
- gemini.md: aus git-Tracking entfernt (git rm --cached)
- README.md: Fehler korrigiert
  - Clone-URL auf Ferocit/comfyui-feroccustomnodes aktualisiert
  - LoadDescriptionNode: Inputs korrigiert (ein file_path-Dropdown,
    kein separates subdirectory + file_name)
  - Pfad-Beispiele auf korrekte Verzeichnisnamen angepasst
  - "printed to console" → "logged" (nach logging-Refactoring)
  - Entwicklungsabschnitt mit pytest-Befehl ergänzt
2026-03-23 13:42:18 +00:00
Mathias 95a8903c73 Refactoring: Alle 8 Issues gelöst
Refactoring: Alle 8 Issues gelöst
2026-03-23 14:40:14 +01:00
Claude 699984be5f docs(#10): Type Hints und Docstrings für öffentliche Node-Methoden ergänzen
- load_description_node.py: load_description() mit Signatur
  (file_path: str, **kwargs) -> tuple[str, str] und Docstring
- feroc_node.py: get_random_lines() mit Signatur
  (seed: int, **kwargs) -> tuple[str] und Docstring
- Nur geänderte Methoden annotiert (kein Over-Engineering)

Closes #10
2026-03-23 13:38:19 +00:00
Claude 739e90ec11 test(#9): Verbleibende Unit-Tests für beide Nodes ergänzen
LoadDescriptionNode:
- TestListAllDescriptionFiles: flache und verschachtelte Dateien, Sortierung
- TestIsChanged: gibt String zurück, erkennt Dateiänderungen, Fallback bei Fehler

RandomLineFromText (bereits in Commit refactor(#6) angelegt):
- Seed-Reproduzierbarkeit, mehrere Dateien, leere Dateien, leere Pfade

Insgesamt 38 Tests, alle grün.

Closes #9
2026-03-23 13:37:35 +00:00
Claude 18ccd469d3 refactor(#6): print() durch logging ersetzt, Tests für Logging-Verhalten
Alle print()-Aufrufe wurden bereits in Commit refactor(#7) durch
logging.warning()/logging.error() in file_utils.py ersetzt.
load_description_node.py und feroc_node.py enthalten kein print() mehr.

Tests dokumentieren das korrekte Logging-Verhalten:
- test_missing_file_logs_warning: prüft via caplog, dass bei fehlender
  Datei ein WARNING im Logger "file_utils" erscheint

Closes #6
2026-03-23 13:36:45 +00:00
Claude 0b5188a4a0 refactor(#5): Doppelte Fallback-Logik in _resolve_file_path extrahieren
- Neue statische Methode _resolve_file_path() in LoadDescriptionNode:
  gibt file_path zurück oder fällt auf ersten verfügbaren Eintrag zurück
- IS_CHANGED() und load_description() delegieren an _resolve_file_path()
  statt die Fallback-Logik zu duplizieren
- 4 neue Tests für alle Fallback-Szenarien (leer, None, "undefined", gesetzt)

Closes #5
2026-03-23 13:35:50 +00:00
Claude b6cc844ce3 refactor(#7): Gemeinsame Datei-Utilities in file_utils.py extrahieren
- file_utils.py angelegt mit: read_text_file(), read_random_line(),
  normalize_description_path()
- load_description_node.py: _abs_path() delegiert an normalize_description_path(),
  load_description() nutzt read_text_file()
- feroc_node.py: get_random_lines() nutzt read_random_line() mit lokalem
  random.Random(seed) statt globalem random.seed()
- tests/test_file_utils.py: 12 Tests für alle file_utils-Funktionen
- tests/test_load_description_node.py: monkeypatch auf file_utils.DESCRIPTION_PATH
  ergänzt für korrekte Test-Isolation

Closes #7
2026-03-23 13:34:58 +00:00
Claude da719f2b93 refactor(#8): Hardcoded Konstanten in config.py zentralisieren
- config.py angelegt mit: DESCRIPTION_PATH, TEXT_FILE_EXTENSION,
  FALLBACK_FILE, MAX_SEED, MAX_FILE_INPUTS
- load_description_node.py: alle Konstanten aus config importiert,
  hardcoded Strings ersetzt
- feroc_node.py: MAX_SEED und MAX_FILE_INPUTS aus config importiert,
  INPUT_TYPES generiert optional-Felder dynamisch über MAX_FILE_INPUTS
- Imports nutzen try/except-Fallback für Test-Kontext ohne Paket

Closes #8
2026-03-23 13:33:09 +00:00
Claude 533c7a4f05 test(#4): Integration-Tests für _abs_path .txt-Extension absichern
Dokumentiert die Behebung des Bugs (aus Issue #3): Die korrekte
_abs_path()-Version hängt .txt an, sodass load_description() Dateien
zuverlässig findet und liest.

Tests:
- Lesen einer vorhandenen .txt-Datei
- Leeres Tuple bei fehlender Datei
- Pfad ohne Extension funktioniert identisch
- Verschachtelte Dateien in Unterordnern

Closes #4
2026-03-23 13:31:57 +00:00
Claude e13c7dbfc4 fix(#3): Doppelte Methodendefinitionen in LoadDescriptionNode entfernen
- Zweite (schwächere) Definition von _abs_path() und IS_CHANGED() entfernt;
  die erste, korrekte Version (mit .txt-Handling und Backslash-Normalisierung) bleibt
- __init__.py mit try/except für relative Imports gesichert (pytest-Kompatibilität)
- pytest-Setup eingerichtet: pytest.ini, conftest.py, tests/test_load_description_node.py
- .gitignore um __pycache__ und .pytest_cache erweitert

Closes #3
2026-03-23 13:31:16 +00:00
async () = process.env.GIT_USERNAME || (await ghUser()).email && (await ghUser()).name || DIE("Missing env.GIT_USERNAME") 1137258bf8 chore(pyproject): Add pyproject.toml for Custom Node Registry 2025-10-22 19:14:39 +00:00
async () = process.env.GIT_USERNAME || (await ghUser()).email && (await ghUser()).name || DIE("Missing env.GIT_USERNAME") 157a37fe1e chore(publish): Add Github Action for Publishing to Comfy Registry 2025-10-22 19:14:38 +00:00
Mathias ad343f332e initial 2025-08-08 23:49:48 +02:00
Mathias a62f536f29 feat: Enhance LoadDescriptionNode with subdirectory and file selection 2025-08-08 21:43:11 +02:00
Mathias e1a4c4896a feat: Remove .idea directory from Git tracking 2025-08-08 21:37:04 +02:00
Mathias 1f5cd75312 initial 2025-08-08 21:35:10 +02:00
Mathias fd618f201f initial 2025-08-08 21:34:01 +02:00