None of the nodes showed description text in ComfyUI because ComfyUI reads obj_class.DESCRIPTION when it builds node_info - it does not read the class docstring, which is what these nodes had. Every registered node now carries a one-line DESCRIPTION, kept to 29-67 characters so it fits the limited space in ComfyUI Manager and the node search results. Image Transform Pro's four-sentence description is shortened to match. Descriptions are derived from each node's existing docstring, or from the README for the five classes that had no docstring (ImageBlendPro, ColorMatchBlend and the three Boolean switch nodes). README also updated for the recent changes: the New Nodes table now lists the real "Rotate & Scale" category, the XY placement direction is documented on both nodes (positive X right, positive Y up), and the v2.2.0 changelog records the placement convention, the node outputs and the MP_ImageTransform internal name.
64 lines
2.3 KiB
Python
64 lines
2.3 KiB
Python
import torch
|
|
|
|
|
|
class ZImageEmptyLatentImage:
|
|
"""
|
|
Empty Latent Image node with Z-Image recommended resolutions.
|
|
Supports resolutions from 512x512 to 2048x2048 optimized for Z-Image model.
|
|
"""
|
|
|
|
DESCRIPTION = "Empty latent using Z-Image recommended resolutions."
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {
|
|
"required": {
|
|
"dimensions": (
|
|
[
|
|
# Landscape
|
|
'2048 x 1024 (landscape 2:1)',
|
|
'1920 x 1080 (landscape 16:9)',
|
|
'1536 x 1024 (landscape 3:2)',
|
|
'1344 x 896 (landscape 3:2)',
|
|
'1280 x 720 (landscape 16:9)',
|
|
'1216 x 832 (landscape 3:2)',
|
|
'1152 x 768 (landscape 3:2)',
|
|
# Square
|
|
'1024 x 1024 (square)',
|
|
' 768 x 768 (square)',
|
|
' 512 x 512 (square)',
|
|
# Portrait
|
|
' 768 x 1152 (portrait 2:3)',
|
|
' 832 x 1216 (portrait 2:3)',
|
|
' 720 x 1280 (portrait 9:16)',
|
|
' 896 x 1344 (portrait 2:3)',
|
|
'1024 x 1536 (portrait 2:3)',
|
|
'1080 x 1920 (portrait 9:16)',
|
|
'1024 x 2048 (portrait 1:2)',
|
|
],
|
|
{
|
|
"default": '1024 x 1024 (square)'
|
|
}
|
|
),
|
|
"batch_size": ("INT", {
|
|
"default": 1,
|
|
"min": 1,
|
|
"max": 64
|
|
}),
|
|
},
|
|
}
|
|
|
|
RETURN_TYPES = ("LATENT", "INT", "INT")
|
|
RETURN_NAMES = ("LATENT", "WIDTH", "HEIGHT")
|
|
FUNCTION = "generate"
|
|
CATEGORY = "MachinePaintingNodes/Util"
|
|
|
|
def generate(self, dimensions, batch_size):
|
|
"""Generates the latent and exposes the width and height"""
|
|
result = [x.strip() for x in dimensions.split('x')]
|
|
width = int(result[0])
|
|
height = int(result[1].split(' ')[0].strip())
|
|
|
|
latent = torch.zeros([batch_size, 4, height // 8, width // 8])
|
|
return ({"samples": latent}, width, height)
|