Add tooltips for nodes in the default workflow

This commit is contained in:
pythongosssss 2024-07-12 14:40:16 +01:00
parent 05f1bf9481
commit 5aa2b89ded

View File

@ -54,7 +54,7 @@ class CLIPTextEncode:
CATEGORY = "conditioning" CATEGORY = "conditioning"
TOOLTIPS = { TOOLTIPS = {
"input": { "input": {
"text": "The text to be encoded", "text": "The text to be encoded.",
"clip": "The CLIP model used for encoding the text.", "clip": "The CLIP model used for encoding the text.",
}, },
"output": ("A conditioning containing the embedded text used to guide the diffusion model.",) "output": ("A conditioning containing the embedded text used to guide the diffusion model.",)
@ -270,6 +270,13 @@ class VAEDecode:
FUNCTION = "decode" FUNCTION = "decode"
CATEGORY = "latent" CATEGORY = "latent"
TOOLTIPS = {
"input": {
"samples": "The latent to be decoded.",
"vae": "The VAE model used for decoding the latent.",
},
"output": ("The decoded image.",)
}
def decode(self, vae, samples): def decode(self, vae, samples):
return (vae.decode(samples["samples"]), ) return (vae.decode(samples["samples"]), )
@ -517,6 +524,12 @@ class CheckpointLoaderSimple:
FUNCTION = "load_checkpoint" FUNCTION = "load_checkpoint"
CATEGORY = "loaders" CATEGORY = "loaders"
TOOLTIPS = {
"input": {
"ckpt_name": "The name of the checkpoint (model) to load.",
},
"output": ("The model used for denoising latents.", "The CLIP model used for encoding text prompts.", "The VAE model used for encoding and decoding images to and from latent space.")
}
def load_checkpoint(self, ckpt_name): def load_checkpoint(self, ckpt_name):
ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name) ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
@ -1046,6 +1059,14 @@ class EmptyLatentImage:
FUNCTION = "generate" FUNCTION = "generate"
CATEGORY = "latent" CATEGORY = "latent"
TOOLTIPS = {
"input": {
"width": "The width of the latent images in pixels.",
"height": "The height of the latent images in pixels.",
"batch_size": "The number of latent images in the batch.",
},
"output": ("The empty latent image batch.",)
}
def generate(self, width, height, batch_size=1): def generate(self, width, height, batch_size=1):
latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device) latent = torch.zeros([batch_size, 4, height // 8, width // 8], device=self.device)
@ -1383,6 +1404,21 @@ class KSampler:
FUNCTION = "sample" FUNCTION = "sample"
CATEGORY = "sampling" CATEGORY = "sampling"
TOOLTIPS = {
"input": {
"model": "The model used for denoising the input latent.",
"seed": "The random seed used for creating the noise.",
"steps": "The number of steps used in the denoising process.",
"cfg": "The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality.",
"sampler_name": "The algorithm used when sampling, this can affect the quality, speed, and style of the generated output.",
"scheduler": "The scheduler controls how noise is gradually removed to form the image.",
"positive": "The conditioning describing the attributes you want to include in the image.",
"negative": "The conditioning describing the attributes you do not want to include in the image.",
"latent_image": "The latent image to denoise.",
"denoise": "The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling.",
},
"output": ("The denoised latent.",)
}
def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0): def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0):
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
@ -1442,6 +1478,12 @@ class SaveImage:
OUTPUT_NODE = True OUTPUT_NODE = True
CATEGORY = "image" CATEGORY = "image"
TOOLTIPS = {
"input": {
"images": "The images to save.",
"filename_prefix": "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.",
}
}
def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None): def save_images(self, images, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None):
filename_prefix += self.prefix_append filename_prefix += self.prefix_append