commit 0b27c727aca4c06e158c5ae75e420cd8408639cc Author: Yahweasel Date: Sat Jan 10 18:27:30 2026 -0500 Initial import diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7e71833 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ede83b2 --- /dev/null +++ b/README.md @@ -0,0 +1,125 @@ +# HuggingFace Diffusers for ComfyUI + +A lot of custom nodes for ComfyUI are really just bindings to HuggingFace +Diffusers, but overly constrained to use them in very particular ways. This set +of custom nodes is intended to be a generic set of bindings for HuggingFace +Diffusers, in theory allowing you to use any pipeline supported by HuggingFace. + +It also supports bitsandbytes quantization, automatic device mapping, and the +other advantages unique to HuggingFace. + +Because HuggingFace pipelines output PIL images, you'll likely need a node to +get PIL images into ComfyUI's format. That node isn't provided by this package; +I recommend +[ComfyUI_Ib_CustomNodes](https://github.com/Chaoses-Ib/ComfyUI_Ib_CustomNodes/). + + +## Philosophy + +I've tried to make everything work fairly generically, as unopinionated as I +can manage. + +Every node that loads a component has some default class that it loads, but you +can replace the class simply by its name. For instance, the pipeline loader +loads `AutoPipelineForText2Image` by default, but you can simply replace +`AutoPipelineForText2Image` with, e.g., `LongCatImagePipeline` to load LongCat +Image instead. + +All of the nodes include a generic `kwargs` parameter, which simply takes text. +Rather than trying to anticipate every possible parameter, I've included only +the most obvious parameters, and for anything else, use `kwargs`. `kwargs` can +be empty (for no extra args) or an object in JSON format. Of course, this is +only sufficient for those arguments that take JSON-compatible values. `kwargs` +overrides other parameters. + +As in HuggingFace, Pipelines are self-loading and include all components, but +you can override the VAE and text encoder components if you wish, so they're +optional inputs. If you want to load *without* these components, use `kwargs` to +set them to `null` (`None`). + +## Workflows + +These are some example workflows, in simple and exploded forms (where by +“exploded” I mean “each step done separately”). + +[LongCat Image](workflows/hf_longcat_image.json) ([exploded](workflows/hf_longcat_image_exploded.json)) + +![LongCat Image](workflows/hf_longcat_image.webp) +![LongCat Image, exploded](workflows/hf_longcat_image_exploded.webp) + +[SDXL](workflows/hf_sdxl.json) ([exploded](workflows/hf_sdxl_exploded.json)) + +![SDXL](workflows/hf_sdxl.webp) +![SDXL, exploded](workflows/hf_sdxl_exploded.webp) + + +## Nodes + +Only the “load pipeline” and “run pipeline” nodes are needed for many use +cases. Plus “load LoRA” to load LoRAs. Other nodes are provided for low-level +control. + +### HF Diffusers load pipeline + +Loads a HuggingFace Diffusers pipeline. By default, loads +`AutoPipelineForText2Image`. Obviously, if the pipeline is supported by +`AutoPipelineForText2Image`, this is the right choice, but any other Diffusers +class can be specified. + +The device and dtype can be set, and the model can be set to automatically +offload to the CPU (`enable_model_cpu_offload`). Quantization is in `dtype`. + +The VAE and text encoder can optionally be overridden, and whether overridden +or not, the VAE is exported. + +### HF Diffusers load LoRA + +Loads a HuggingFace Diffusers LoRA onto a pipeline. Note that the original, +un-LoRA'd pipeline *cannot* be used by simply connecting the original “load +pipeline” node. The non-LoRA version is lost. + +### HF Diffusers run pipeline + +Runs a HuggingFace Diffusers pipeline. + +For image-to-image and inpainting pipelines, supports (optional) image and mask +inputs. + +The most common/necessary parameters (prompts and image size) are supported +directly. Other arguments can be provided by `kwargs`. If `num_inference_steps` +is set to 0, the default number of steps for the pipeline is used. + +Supports outputting latents or PIL images, but not both at the same time (i.e., +only one of the two outputs will be activated, based on which you chose). + +## HF Diffusers load AutoencoderKL (VAE) + +Loads a VAE directly. Generally speaking, the pipeline loads its own VAE, but +you can use this to use a custom VAE, or to, e.g., load the VAE on a different +device than the rest of the pipeline. + +## HF Transformers load model + +Load a HuggingFace *Transformers* (not Diffusers) model. Generally for the text +encoder. The pipeline loads its own text encoder, but you can use this to use a +custom encoder or load it on a different device, etc. + +## HF Diffusers encode prompt + +Use a HuggingFace Diffusers pipeline to encode a prompt into `prompt_embeds`. + +Unfortunately, the way that `encode_prompt` works varies from pipeline to +pipeline. So, I simply provide four tensors as output, and you need to know how +the pipeline works to know which you need and where. + +Some examples: + + * SDXL: `(prompt_embeds, negative_prompt_embeds, pooled_prompt_embeds, pooled_negative_prompt_embeds)` + * Flux: `(prompt_embeds, pooled_prompt_embeds, _)` + * Z Image: `(prompt_embeds, negative_prompt_embeds)` + * LongCat Image: `(prompt_embeds, _)` (but the pipeline doesn't support `prompt_embeds`) + +## HF Diffusers VAE decode/encode + +Use these to decode/encode HuggingFace latents using HuggingFace VAEs. +Automatic if pipelines are run in PIL mode. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..dc2cd57 --- /dev/null +++ b/__init__.py @@ -0,0 +1,45 @@ +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or distribute +# this software, either in source code form or as a compiled binary, for any +# purpose, commercial or non-commercial, and by any means. +# +# In jurisdictions that recognize copyright laws, the author or authors of this +# software dedicate any and all copyright interest in the software to the public +# domain. We make this dedication for the benefit of the public at large and to +# the detriment of our heirs and successors. We intend this dedication to be an +# overt act of relinquishment in perpetuity of all present and future rights to +# this software under copyright law. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +from .diffusers_nodes import * + +NODE_CLASS_MAPPINGS = { + "HFDLoadPipeline": HFDLoadPipeline, + "HFDLoadLora": HFDLoadLora, + "HFDAutoencoderKL": HFDAutoencoderKL, + "HFTAutoModel": HFTAutoModel, + "HFDRunPipeline": HFDRunPipeline, + "HFDEncodePrompt": HFDEncodePrompt, + "HFDVAEDecode": HFDVAEDecode, + "HFDVAEEncode": HFDVAEEncode, +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "HFDLoadPipeline": "HF Diffusers load pipeline", + "HFDLoadLora": "HF Diffusers load LoRA", + "HFDAutoencoderKL": "HF Diffusers load AutoencoderKL (VAE)", + "HFTAutoModel": "HF Transformers load model", + "HFDRunPipeline": "HF Diffusers run pipeline", + "HFDEncodePrompt": "HF Diffusers encode prompt", + "HFDVAEDecode": "HF Diffusers VAE decode", + "HFDVAEEncode": "HF Diffusers VAE encode", +} + +__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] diff --git a/diffusers_nodes.py b/diffusers_nodes.py new file mode 100644 index 0000000..6f38a76 --- /dev/null +++ b/diffusers_nodes.py @@ -0,0 +1,387 @@ +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or distribute +# this software, either in source code form or as a compiled binary, for any +# purpose, commercial or non-commercial, and by any means. +# +# In jurisdictions that recognize copyright laws, the author or authors of this +# software dedicate any and all copyright interest in the software to the public +# domain. We make this dedication for the benefit of the public at large and to +# the detriment of our heirs and successors. We intend this dedication to be an +# overt act of relinquishment in perpetuity of all present and future rights to +# this software under copyright law. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import json + +import diffusers +import diffusers.image_processor as diffusers_image_processor +import torch +import transformers + +DEVICES = ["default", "auto", "cpu"] +DEFAULT_DEVICE = "cpu" +if torch.cuda.is_available(): + DEVICES.append("cuda") + for i in range(torch.cuda.device_count()): + DEVICES.append(f"cuda:{i}") + DEFAULT_DEVICE = "cuda" +DTYPES = ("default", "float32", "bfloat16", "float16", "bitsandbytes_8bit", "bitsandbytes_4bit") + +def get_device(device): + if device == "default": + return DEFAULT_DEVICE + else: + return device + +def mkkwargs(kwargs): + """ + Return kwargs appropriate for HuggingFace models. + """ + ret = {} + if "kwargs" in kwargs and kwargs["kwargs"] != "": + ret = json.loads(kwargs["kwargs"]) + for key in kwargs: + if key == "kwargs": + continue + if key not in ret and kwargs[key] is not None: + ret[key] = kwargs[key] + return ret + +def apply_device(kwargs, device, dtype, enable_model_cpu_offload=False, quant="pipeline"): + """ + Apply device and dtype properties to the kwargs. Quantizes in pipeline, + transformers, or diffusers mode. Returns the device that the result should + be moved to with `to`, or `None` if not needed. + """ + device = get_device(device) + to_device = None + if not enable_model_cpu_offload: + if ":" in device: + to_device = device + else: + kwargs["device_map"] = get_device(device) + kwargs["torch_dtype"] = torch.bfloat16 + + if dtype[0:13] == "bitsandbytes_": + if quant == "transformers" or quant == "diffusers": + qc = {} + if dtype == "bitsandbytes_4bit": + qc["load_in_4bit"] = True + else: + qc["load_in_8bit"] = True + if quant == "transformers": + qc = transformers.BitsAndBytesConfig(**qc) + else: + qc = diffusers.BitsAndBytesConfig(**qc) + kwargs["quantization_config"] = qc + + else: # "pipeline" + qc = { + "quant_backend": dtype + } + if dtype == "bitsandbytes_4bit": + qc["quant_kwargs"] = {"load_in_4bit": True} + else: + qc["quant_kwargs"] = {"load_in_8bit": True} + kwargs["quantization_config"] = diffusers.PipelineQuantizationConfig(**qc) + + elif dtype == "float32": + kwargs["torch_dtype"] = torch.float32 + elif dtype == "float16": + kwargs["torch_dtype"] = torch.float16 + + return to_device + +class HFDLoadPipeline: + """ + Load a HuggingFace Diffusers pipeline. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "pipeline_class": ("STRING", {"default": "AutoPipelineForText2Image"}), + "model": ("STRING", {"default": "stabilityai/stable-diffusion-xl-base-1.0"}), + "device": (DEVICES,), + "enable_model_cpu_offload": ([False, True],), + "dtype": (DTYPES,), + "kwargs": ("STRING",), + }, + "optional": { + "vae": ("HFD_AUTOENCODERKL",), + "text_encoder": ("HFT_MODEL",), + } + } + + RETURN_TYPES = ("HFD_PIPELINE", "HFD_AUTOENCODERKL") + FUNCTION = "load" + + CATEGORY = "huggingface-diffusers" + + def load( + self, pipeline_class, model, device, enable_model_cpu_offload, dtype, + **kwargs + ): + kwargs = mkkwargs(kwargs) + to_device = apply_device( + kwargs, device, dtype, + enable_model_cpu_offload=enable_model_cpu_offload + ) + pipeline = getattr(diffusers, pipeline_class).from_pretrained( + model, **kwargs + ) + if to_device: + pipeline.to(to_device) + if enable_model_cpu_offload: + pipeline.enable_model_cpu_offload() + return (pipeline, pipeline.vae) + +class HFDLoadLora: + """ + Load a Lora into a HuggingFace pipeline. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "pipeline": ("HFD_PIPELINE",), + "pretrained_model_name_or_path_or_dict": ("STRING", {"default": "TheLastBen/Papercut_SDXL"}), + "weight": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 2.0}), + "kwargs": ("STRING",), + } + } + + RETURN_TYPES = ("HFD_PIPELINE",) + FUNCTION = "load" + + CATEGORY = "huggingface-diffusers" + + def load(self, pipeline, weight, **kwargs): + kwargs = mkkwargs(kwargs) + pipeline.load_lora_weights(**kwargs) + pipeline.fuse_lora(lora_scale=weight) + pipeline.unload_lora_weights() + return (pipeline,) + +class HFDAutoencoderKL: + """ + Load an Autoencoder. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "autoencoder_class": ("STRING", {"default": "AutoencoderKL"}), + "pretrained_model_name_or_path": ("STRING", {"default": "stabilityai/stable-diffusion-xl-base-1.0"}), + "subfolder": ("STRING", {"default": "vae"}), + "device": (DEVICES,), + "dtype": (DTYPES,), + "kwargs": ("STRING",), + } + } + + RETURN_TYPES = ("HFD_AUTOENCODERKL",) + FUNCTION = "load" + + CATEGORY = "huggingface-diffusers" + + def load(self, autoencoder_class, device, dtype, **kwargs): + kwargs = mkkwargs(kwargs) + to_device = apply_device(kwargs, device, dtype, quant="diffusers") + vae = getattr(diffusers, autoencoder_class).from_pretrained(**kwargs) + if to_device: + vae.to(to_device) + return (vae,) + +class HFTAutoModel: + """ + Load a transformers model. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "model_class": ("STRING", {"default": "AutoModel"}), + "pretrained_model_name_or_path": ("STRING", {"default": "stabilityai/stable-diffusion-xl-base-1.0"}), + "subfolder": ("STRING", {"default": "text_encoder"}), + "device": (DEVICES,), + "dtype": (DTYPES,), + "kwargs": ("STRING",), + } + } + + RETURN_TYPES = ("HFT_MODEL",) + FUNCTION = "load" + + CATEGORY = "huggingface-transformers" + + def load(self, model_class, device, dtype, **kwargs): + kwargs = mkkwargs(kwargs) + to_device = apply_device(kwargs, device, dtype, quant="transformers") + model = getattr(transformers, model_class).from_pretrained(**kwargs) + if to_device: + model.to(to_device) + return (model,) + +class HFDRunPipeline: + """ + Run HuggingFace pipelines. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "pipeline": ("HFD_PIPELINE",), + "prompt": ("STRING", {"default": "a photo of an astronaut riding a horse on mars"}), + "negative_prompt": ("STRING",), + "width": ("INT", {"default": 1024}), + "height": ("INT", {"default": 1024}), + "seed": ("INT", {"default": 1, "min": 0, "max": 0xffffffffffffffff}), + "num_inference_steps": ("INT", {"default": 0, "min": 0, "max": 0x10000}), + "output_type": (["pil", "latent"],), + "kwargs": ("STRING",), + }, + "optional": { + "image": ("PIL_IMAGE",), + "mask_image": ("PIL_IMAGE",), + "latents": ("LATENT",), + "prompt_embeds": ("TENSOR",), + "pooled_prompt_embeds": ("TENSOR",), + "negative_prompt_embeds": ("TENSOR",), + "negative_pooled_prompt_embeds": ("TENSOR",), + } + } + + RETURN_TYPES = ("PIL_IMAGE", "LATENT") + FUNCTION = "generate" + + CATEGORY = "huggingface-diffusers" + + def generate( + self, negative_prompt, pipeline, seed, num_inference_steps, **kwargs + ): + kwargs = mkkwargs(kwargs) + if "prompt_embeds" in kwargs: + del kwargs["prompt"] + if "negative_prompt_embeds" not in kwargs and negative_prompt != "": + kwargs["negative_prompt"] = negative_prompt + if num_inference_steps > 0: + kwargs["num_inference_steps"] = num_inference_steps + with torch.no_grad(): + generator = torch.manual_seed(seed) + r = pipeline( + generator=generator, + **kwargs + ) + if kwargs["output_type"] == "pil": + return (r.images[0], None) + else: + return (None, r.images) + +class HFDEncodePrompt: + """ + Encode a prompt using a HuggingFace pipeline. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "pipeline": ("HFD_PIPELINE",), + "prompt": ("STRING", {"default": "a photo of an astronaut riding a horse on mars"}), + "kwargs": ("STRING",), + } + } + + RETURN_TYPES = ("TENSOR", "TENSOR", "TENSOR", "TENSOR") + FUNCTION = "encode" + + CATEGORY = "huggingface-diffusers" + + def encode(self, pipeline, prompt, kwargs): + kwargs = mkkwargs(kwargs) + r = list(pipeline.encode_prompt(prompt, **kwargs)) + while len(r) < 4: + r.append(None) + return tuple(r) + +class HFDVAEDecode: + """ + VAE decoding using HuggingFace diffusers. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "latents": ("LATENT",), + "vae": ("HFD_AUTOENCODERKL",), + } + } + + RETURN_TYPES = ("PIL_IMAGE",) + FUNCTION = "decode" + + CATEGORY = "huggingface-diffusers" + + def decode(self, latents, vae): + image_processor = diffusers_image_processor.VaeImageProcessor( + vae_scale_factor=2**(len(vae.config.block_out_channels) - 1) + ) + with torch.no_grad(): + image = vae.decode( + (latents / vae.config.scaling_factor).to(device=vae.device, dtype=vae.dtype), + return_dict=False + )[0] + image = image_processor.postprocess(image) + return (image,) + +class HFDVAEEncode: + """ + VAE encoding using HuggingFace diffusers. + """ + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "image": ("PIL_IMAGE",), + "vae": ("HFD_AUTOENCODERKL",), + } + } + + RETURN_TYPES = ("LATENT",) + FUNCTION = "encode" + + CATEGORY = "huggingface-diffusers" + + def encode(self, image, vae): + image_processor = diffusers_image_processor.VaeImageProcessor( + vae_scale_factor=2**(len(vae.config.block_out_channels) - 1) + ) + if isinstance(image, list): + image = image[0] + latents = image_processor.preprocess( + image, + height=image.height, + width=image.width + ).to(device=vae.device, dtype=vae.dtype) + with torch.no_grad(): + latents = vae.encode( + latents, + return_dict=False + )[0].sample() + latents *= vae.config.scaling_factor + return (latents,) diff --git a/workflows/hf_longcat_image.json b/workflows/hf_longcat_image.json new file mode 100644 index 0000000..3cc17e1 --- /dev/null +++ b/workflows/hf_longcat_image.json @@ -0,0 +1,260 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 18, + "last_link_id": 20, + "nodes": [ + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1380, + 320 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 19 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 320 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 19 + ] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "", + 1152, + 896, + 1, + "fixed", + 20, + "pil", + "{\"guidance_scale\": 4}" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": null + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": null + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "LongCatImagePipeline", + "meituan-longcat/LongCat-Image", + "default", + false, + "bitsandbytes_8bit", + "" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 19, + 16, + 0, + 17, + 0, + "PIL_IMAGE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 1.263157894736842, + "offset": [ + -480, + -140.1875 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_longcat_image.webp b/workflows/hf_longcat_image.webp new file mode 100644 index 0000000..180e860 Binary files /dev/null and b/workflows/hf_longcat_image.webp differ diff --git a/workflows/hf_longcat_image_exploded.json b/workflows/hf_longcat_image_exploded.json new file mode 100644 index 0000000..5fb68e6 --- /dev/null +++ b/workflows/hf_longcat_image_exploded.json @@ -0,0 +1,348 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 22, + "last_link_id": 32, + "nodes": [ + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1370, + 410 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 32 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 19, + "type": "HFDAutoencoderKL", + "pos": [ + 300, + 320 + ], + "size": [ + 362.58331909179685, + 178 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [ + 21 + ] + } + ], + "properties": { + "Node name for S&R": "HFDAutoencoderKL" + }, + "widgets_values": [ + "AutoencoderKL", + "meituan-longcat/LongCat-Image", + "vae", + "default", + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": 21 + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": 22 + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [] + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "LongCatImagePipeline", + "meituan-longcat/LongCat-Image", + "default", + false, + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 20, + "type": "HFTAutoModel", + "pos": [ + 300, + 540 + ], + "size": [ + 348.5500030517578, + 178 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFT_MODEL", + "type": "HFT_MODEL", + "links": [ + 22 + ] + } + ], + "properties": { + "Node name for S&R": "HFTAutoModel" + }, + "widgets_values": [ + "Qwen2_5_VLForConditionalGeneration", + "meituan-longcat/LongCat-Image", + "text_encoder", + "default", + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 500 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 32 + ] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": [] + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "", + 1152, + 896, + 1, + "fixed", + 20, + "pil", + "{\"guidance_scale\": 4}" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ], + [ + 21, + 19, + 0, + 15, + 0, + "HFD_AUTOENCODERKL" + ], + [ + 22, + 20, + 0, + 15, + 1, + "HFT_MODEL" + ], + [ + 32, + 16, + 0, + 17, + 0, + "PIL_IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.9473684210526314, + "offset": [ + -36.66666666666663, + -110.25 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_longcat_image_exploded.webp b/workflows/hf_longcat_image_exploded.webp new file mode 100644 index 0000000..c3735b9 Binary files /dev/null and b/workflows/hf_longcat_image_exploded.webp differ diff --git a/workflows/hf_sdxl.json b/workflows/hf_sdxl.json new file mode 100644 index 0000000..6399830 --- /dev/null +++ b/workflows/hf_sdxl.json @@ -0,0 +1,260 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 18, + "last_link_id": 20, + "nodes": [ + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1380, + 320 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 19 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": null + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": null + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "AutoPipelineForText2Image", + "stabilityai/stable-diffusion-xl-base-1.0", + "default", + false, + "default", + "" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 320 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 19 + ] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "", + 1152, + 896, + 1, + "fixed", + 20, + "pil", + "" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 19, + 16, + 0, + 17, + 0, + "PIL_IMAGE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 1.263157894736842, + "offset": [ + -480, + -140.1875 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_sdxl.webp b/workflows/hf_sdxl.webp new file mode 100644 index 0000000..09a7b73 Binary files /dev/null and b/workflows/hf_sdxl.webp differ diff --git a/workflows/hf_sdxl_exploded.json b/workflows/hf_sdxl_exploded.json new file mode 100644 index 0000000..4a363fc --- /dev/null +++ b/workflows/hf_sdxl_exploded.json @@ -0,0 +1,506 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 22, + "last_link_id": 31, + "nodes": [ + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1370, + 410 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 28 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 22, + "type": "HFDVAEDecode", + "pos": [ + 1310, + 320 + ], + "size": [ + 206.79999389648438, + 46 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "latents", + "type": "LATENT", + "link": 26 + }, + { + "name": "vae", + "type": "HFD_AUTOENCODERKL", + "link": 27 + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 28 + ] + } + ], + "properties": { + "Node name for S&R": "HFDVAEDecode" + }, + "widgets_values": [] + }, + { + "id": 19, + "type": "HFDAutoencoderKL", + "pos": [ + 300, + 320 + ], + "size": [ + 362.58331909179685, + 178 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [ + 21 + ] + } + ], + "properties": { + "Node name for S&R": "HFDAutoencoderKL" + }, + "widgets_values": [ + "AutoencoderKL", + "stabilityai/stable-diffusion-xl-base-1.0", + "vae", + "default", + "default", + "" + ] + }, + { + "id": 20, + "type": "HFTAutoModel", + "pos": [ + 300, + 540 + ], + "size": [ + 348.5500030517578, + 178 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFT_MODEL", + "type": "HFT_MODEL", + "links": [ + 22 + ] + } + ], + "properties": { + "Node name for S&R": "HFTAutoModel" + }, + "widgets_values": [ + "AutoModel", + "stabilityai/stable-diffusion-xl-base-1.0", + "text_encoder", + "default", + "default", + "" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": 21 + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": 22 + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18, + 23 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [ + 27 + ] + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "AutoPipelineForText2Image", + "stabilityai/stable-diffusion-xl-base-1.0", + "default", + false, + "default", + "" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 500 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": 29 + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": 30 + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": 25 + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": 31 + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 26 + ] + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "", + "", + 1152, + 896, + 1, + "fixed", + 20, + "latent", + "" + ] + }, + { + "id": 21, + "type": "HFDEncodePrompt", + "pos": [ + 1010, + 320 + ], + "size": [ + 287.1333374023437, + 142 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 23 + } + ], + "outputs": [ + { + "name": "TENSOR", + "type": "TENSOR", + "links": [ + 29 + ] + }, + { + "name": "TENSOR", + "type": "TENSOR", + "links": [ + 25 + ] + }, + { + "name": "TENSOR", + "type": "TENSOR", + "links": [ + 30 + ] + }, + { + "name": "TENSOR", + "type": "TENSOR", + "links": [ + 31 + ] + } + ], + "properties": { + "Node name for S&R": "HFDEncodePrompt" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ], + [ + 21, + 19, + 0, + 15, + 0, + "HFD_AUTOENCODERKL" + ], + [ + 22, + 20, + 0, + 15, + 1, + "HFT_MODEL" + ], + [ + 23, + 15, + 0, + 21, + 0, + "HFD_PIPELINE" + ], + [ + 25, + 21, + 1, + 16, + 6, + "TENSOR" + ], + [ + 26, + 16, + 1, + 22, + 0, + "LATENT" + ], + [ + 27, + 15, + 1, + 22, + 1, + "HFD_AUTOENCODERKL" + ], + [ + 28, + 22, + 0, + 17, + 0, + "PIL_IMAGE" + ], + [ + 29, + 21, + 0, + 16, + 4, + "TENSOR" + ], + [ + 30, + 21, + 2, + 16, + 5, + "TENSOR" + ], + [ + 31, + 21, + 3, + 16, + 7, + "TENSOR" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.9473684210526314, + "offset": [ + -36.66666666666663, + -110.25 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_sdxl_exploded.webp b/workflows/hf_sdxl_exploded.webp new file mode 100644 index 0000000..6542670 Binary files /dev/null and b/workflows/hf_sdxl_exploded.webp differ diff --git a/workflows/hf_z_image_turbo.json b/workflows/hf_z_image_turbo.json new file mode 100644 index 0000000..b948149 --- /dev/null +++ b/workflows/hf_z_image_turbo.json @@ -0,0 +1,260 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 18, + "last_link_id": 20, + "nodes": [ + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1380, + 320 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 19 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": null + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": null + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "AutoPipelineForText2Image", + "Tongyi-MAI/Z-Image-Turbo", + "default", + false, + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 320 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 19 + ] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "", + 1152, + 896, + 1, + "fixed", + 9, + "pil", + "{\"guidance_scale\": 0}" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 19, + 16, + 0, + 17, + 0, + "PIL_IMAGE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 1.263157894736842, + "offset": [ + -480, + -140.1875 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_z_image_turbo.webp b/workflows/hf_z_image_turbo.webp new file mode 100644 index 0000000..54a685a Binary files /dev/null and b/workflows/hf_z_image_turbo.webp differ diff --git a/workflows/hf_z_image_turbo_exploded.json b/workflows/hf_z_image_turbo_exploded.json new file mode 100644 index 0000000..29cf34a --- /dev/null +++ b/workflows/hf_z_image_turbo_exploded.json @@ -0,0 +1,486 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 22, + "last_link_id": 28, + "nodes": [ + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 19, + "type": "HFDAutoencoderKL", + "pos": [ + 300, + 320 + ], + "size": [ + 362.58331909179685, + 178 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [ + 21 + ] + } + ], + "properties": { + "Node name for S&R": "HFDAutoencoderKL" + }, + "widgets_values": [ + "AutoencoderKL", + "Tongyi-MAI/Z-Image-Turbo", + "vae", + "default", + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 20, + "type": "HFTAutoModel", + "pos": [ + 300, + 540 + ], + "size": [ + 348.5500030517578, + 178 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFT_MODEL", + "type": "HFT_MODEL", + "links": [ + 22 + ] + } + ], + "properties": { + "Node name for S&R": "HFTAutoModel" + }, + "widgets_values": [ + "AutoModel", + "Tongyi-MAI/Z-Image-Turbo", + "text_encoder", + "default", + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 21, + "type": "HFDEncodePrompt", + "pos": [ + 1010, + 320 + ], + "size": [ + 287.1333374023437, + 142 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 23 + } + ], + "outputs": [ + { + "name": "TENSOR", + "type": "TENSOR", + "links": [ + 24 + ] + }, + { + "name": "TENSOR", + "type": "TENSOR", + "links": [ + 25 + ] + }, + { + "name": "TENSOR", + "type": "TENSOR", + "links": null + }, + { + "name": "TENSOR", + "type": "TENSOR", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDEncodePrompt" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": 21 + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": 22 + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18, + 23 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [ + 27 + ] + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "AutoPipelineForText2Image", + "Tongyi-MAI/Z-Image-Turbo", + "default", + false, + "bitsandbytes_8bit", + "" + ] + }, + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1370, + 410 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 28 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 22, + "type": "HFDVAEDecode", + "pos": [ + 1310, + 320 + ], + "size": [ + 206.79999389648438, + 46 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "latents", + "type": "LATENT", + "link": 26 + }, + { + "name": "vae", + "type": "HFD_AUTOENCODERKL", + "link": 27 + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 28 + ] + } + ], + "properties": { + "Node name for S&R": "HFDVAEDecode" + }, + "widgets_values": [] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 500 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": 24 + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": 25 + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 26 + ] + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "", + "", + 1152, + 896, + 1, + "fixed", + 9, + "latent", + "{\"guidance_scale\": 0}" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ], + [ + 21, + 19, + 0, + 15, + 0, + "HFD_AUTOENCODERKL" + ], + [ + 22, + 20, + 0, + 15, + 1, + "HFT_MODEL" + ], + [ + 23, + 15, + 0, + 21, + 0, + "HFD_PIPELINE" + ], + [ + 24, + 21, + 0, + 16, + 4, + "TENSOR" + ], + [ + 25, + 21, + 1, + 16, + 6, + "TENSOR" + ], + [ + 26, + 16, + 1, + 22, + 0, + "LATENT" + ], + [ + 27, + 15, + 1, + 22, + 1, + "HFD_AUTOENCODERKL" + ], + [ + 28, + 22, + 0, + 17, + 0, + "PIL_IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.9473684210526314, + "offset": [ + -36.66666666666663, + -110.25 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_z_image_turbo_exploded.webp b/workflows/hf_z_image_turbo_exploded.webp new file mode 100644 index 0000000..546a205 Binary files /dev/null and b/workflows/hf_z_image_turbo_exploded.webp differ