* 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>
27 lines
900 B
Python
27 lines
900 B
Python
try:
|
|
from .random_line_from_text_node import RandomLineFromTextNode
|
|
from .load_description_node import LoadDescriptionNode
|
|
from .text_template_node import TextTemplateNode
|
|
from .megapixel_scale_node import MegapixelScaleNode
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"RandomLineFromText": RandomLineFromTextNode,
|
|
"LoadDescriptionNode": LoadDescriptionNode,
|
|
"TextTemplate": TextTemplateNode,
|
|
"MegapixelScale": MegapixelScaleNode,
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"RandomLineFromText": "Random Line From Text",
|
|
"LoadDescriptionNode": "Load Description",
|
|
"TextTemplate": "Text Template",
|
|
"MegapixelScale": "Megapixel Scale",
|
|
}
|
|
|
|
__all__ = [
|
|
'NODE_CLASS_MAPPINGS',
|
|
'NODE_DISPLAY_NAME_MAPPINGS',
|
|
]
|
|
except ImportError:
|
|
# Outside of a ComfyUI package context (e.g., running tests standalone)
|
|
pass |