* 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>
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
_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
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
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
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
- 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
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
- 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