"vscode:/vscode.git/clone" did not exist on "de16f64667473ecb9503fc46a688c29ce2585377"
Unverified Commit f060b8da authored by Muyang Li's avatar Muyang Li Committed by GitHub
Browse files

[Major] Release v0.1.4

Support 4-bit text encoder and per-layer CPU offloading, reducing FLUX's minimum memory requirement to just 4 GiB while maintaining a 2–3× speedup. Fix various issues related to resolution, LoRA, pin memory, and runtime stability. Check out the release notes for full details!
parents f549dfc6 873a35be
...@@ -6,6 +6,7 @@ Chere [here](https://github.com/mit-han-lab/nunchaku/issues/149) to join our use ...@@ -6,6 +6,7 @@ Chere [here](https://github.com/mit-han-lab/nunchaku/issues/149) to join our use
### [Paper](http://arxiv.org/abs/2411.05007) | [Project](https://hanlab.mit.edu/projects/svdquant) | [Blog](https://hanlab.mit.edu/blog/svdquant) | [Demo](https://svdquant.mit.edu) ### [Paper](http://arxiv.org/abs/2411.05007) | [Project](https://hanlab.mit.edu/projects/svdquant) | [Blog](https://hanlab.mit.edu/blog/svdquant) | [Demo](https://svdquant.mit.edu)
- **[2025-03-07]** 🚀 **Nunchaku v0.1.4 Released!** We've supported [4-bit text encoder and per-layer CPU offloading](#Low-Memory-Inference), reducing FLUX's minimum memory requirement to just **4 GiB** while maintaining a **2–3× speedup**. This update also fixes various issues related to resolution, LoRA, pin memory, and runtime stability. Check out the release notes for full details!
- **[2025-02-20]** 🚀 We release the [pre-built wheels](https://huggingface.co/mit-han-lab/nunchaku) to simplify installation! Check [here](#Installation) for the guidance! - **[2025-02-20]** 🚀 We release the [pre-built wheels](https://huggingface.co/mit-han-lab/nunchaku) to simplify installation! Check [here](#Installation) for the guidance!
- **[2025-02-20]** 🚀 **Support NVFP4 precision on NVIDIA RTX 5090!** NVFP4 delivers superior image quality compared to INT4, offering **~3× speedup** on the RTX 5090 over BF16. Learn more in our [blog](https://hanlab.mit.edu/blog/svdquant-nvfp4), checkout [`examples`](./examples) for usage and try [our demo](https://svdquant.mit.edu/flux1-schnell/) online! - **[2025-02-20]** 🚀 **Support NVFP4 precision on NVIDIA RTX 5090!** NVFP4 delivers superior image quality compared to INT4, offering **~3× speedup** on the RTX 5090 over BF16. Learn more in our [blog](https://hanlab.mit.edu/blog/svdquant-nvfp4), checkout [`examples`](./examples) for usage and try [our demo](https://svdquant.mit.edu/flux1-schnell/) online!
- **[2025-02-18]** 🔥 [**Customized LoRA conversion**](#Customized-LoRA) and [**model quantization**](#Customized-Model-Quantization) instructions are now available! **[ComfyUI](./comfyui)** workflows now support **customized LoRA**, along with **FLUX.1-Tools**! - **[2025-02-18]** 🔥 [**Customized LoRA conversion**](#Customized-LoRA) and [**model quantization**](#Customized-Model-Quantization) instructions are now available! **[ComfyUI](./comfyui)** workflows now support **customized LoRA**, along with **FLUX.1-Tools**!
...@@ -45,18 +46,27 @@ SVDQuant is a post-training quantization technique for 4-bit weights and activat ...@@ -45,18 +46,27 @@ SVDQuant is a post-training quantization technique for 4-bit weights and activat
## Installation ## Installation
### Wheels (Linux only for now) ### Wheels (for Linux and Windows WSL)
#### For Windows Users
To install and use WSL (Windows Subsystem for Linux), follow the instructions [here](https://learn.microsoft.com/en-us/windows/wsl/install). You can also install WSL directly by running the following commands in PowerShell:
```shell
wsl --install # install the latest WSL
wsl # launch WSL
```
#### Prerequisites for all users
Before installation, ensure you have [PyTorch>=2.5](https://pytorch.org/) installed. For example, you can use the following command to install PyTorch 2.6: Before installation, ensure you have [PyTorch>=2.5](https://pytorch.org/) installed. For example, you can use the following command to install PyTorch 2.6:
```shell ```shell
pip install torch==2.6 torchvision==0.21 torchaudio==2.6 pip install torch==2.6 torchvision==0.21 torchaudio==2.6
``` ```
#### Installing nunchaku
Once PyTorch is installed, you can directly install `nunchaku` from our [Hugging Face repository](https://huggingface.co/mit-han-lab/nunchaku/tree/main). Be sure to select the appropriate wheel for your Python and PyTorch version. For example, for Python 3.11 and PyTorch 2.6: Once PyTorch is installed, you can directly install `nunchaku` from our [Hugging Face repository](https://huggingface.co/mit-han-lab/nunchaku/tree/main). Be sure to select the appropriate wheel for your Python and PyTorch version. For example, for Python 3.11 and PyTorch 2.6:
```shell ```shell
pip install https://huggingface.co/mit-han-lab/nunchaku/resolve/main/nunchaku-0.1.3+torch2.6-cp311-cp311-linux_x86_64.whl pip install https://huggingface.co/mit-han-lab/nunchaku/resolve/main/nunchaku-0.1.4+torch2.6-cp311-cp311-linux_x86_64.whl
``` ```
**Note**: NVFP4 wheels are not currently available because PyTorch has not officially supported CUDA 11.8. To use NVFP4, you will need **Blackwell GPUs (e.g., 50-series GPUs)** and must **build from source**. **Note**: NVFP4 wheels are not currently available because PyTorch has not officially supported CUDA 11.8. To use NVFP4, you will need **Blackwell GPUs (e.g., 50-series GPUs)** and must **build from source**.
...@@ -81,7 +91,7 @@ pip install https://huggingface.co/mit-han-lab/nunchaku/resolve/main/nunchaku-0. ...@@ -81,7 +91,7 @@ pip install https://huggingface.co/mit-han-lab/nunchaku/resolve/main/nunchaku-0.
pip install peft opencv-python gradio spaces GPUtil # For gradio demos pip install peft opencv-python gradio spaces GPUtil # For gradio demos
``` ```
To enable NVFP4 on Blackwell GPUs (e.g., 50-series GPUs), please install nightly PyTorch with CUDA 12.8. The installation command can be: To enable NVFP4 on Blackwell GPUs (e.g., 50-series GPUs), please install nightly PyTorch with CUDA 12.8. The installation command can be:
```shell ```shell
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128 pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
...@@ -113,7 +123,7 @@ In [examples](examples), we provide minimal scripts for running INT4 [FLUX.1](ht ...@@ -113,7 +123,7 @@ In [examples](examples), we provide minimal scripts for running INT4 [FLUX.1](ht
import torch import torch
from diffusers import FluxPipeline from diffusers import FluxPipeline
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku import NunchakuFluxTransformer2dModel
transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-dev") transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-dev")
pipeline = FluxPipeline.from_pretrained( pipeline = FluxPipeline.from_pretrained(
...@@ -125,6 +135,28 @@ image.save("flux.1-dev.png") ...@@ -125,6 +135,28 @@ image.save("flux.1-dev.png")
Specifically, `nunchaku` shares the same APIs as [diffusers](https://github.com/huggingface/diffusers) and can be used in a similar way. Specifically, `nunchaku` shares the same APIs as [diffusers](https://github.com/huggingface/diffusers) and can be used in a similar way.
### Low Memory Inference
To further reduce GPU memory usage, you can use our 4-bit T5 encoder along with CPU offloading, requiring a minimum of just 4GiB of memory. The usage is also simple in the diffusers' way. For example, the [script](examples/int4-flux.1-dev-qencoder.py) for FLUX.1-dev is as follows:
```python
import torch
from diffusers import FluxPipeline
from nunchaku import NunchakuFluxTransformer2dModel, NunchakuT5EncoderModel
transformer = NunchakuFluxTransformer2dModel.from_pretrained(
"mit-han-lab/svdq-int4-flux.1-dev", offload=True
) # set offload to False if you want to disable offloading
text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5")
pipeline = FluxPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev", text_encoder_2=text_encoder_2, transformer=transformer, torch_dtype=torch.bfloat16
).to("cuda")
pipeline.enable_sequential_cpu_offload() # remove this line if you want to disable the CPU offloading
image = pipeline("A cat holding a sign that says hello world", num_inference_steps=50, guidance_scale=3.5).images[0]
image.save("flux.1-dev.png")
```
## Customized LoRA ## Customized LoRA
![lora](./assets/lora.jpg) ![lora](./assets/lora.jpg)
...@@ -168,7 +200,7 @@ transformer.set_lora_strength(lora_strength) ...@@ -168,7 +200,7 @@ transformer.set_lora_strength(lora_strength)
import torch import torch
from diffusers import FluxPipeline from diffusers import FluxPipeline
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku import NunchakuFluxTransformer2dModel
transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-dev") transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-dev")
pipeline = FluxPipeline.from_pretrained( pipeline = FluxPipeline.from_pretrained(
......
...@@ -12,7 +12,7 @@ from image_gen_aux import DepthPreprocessor ...@@ -12,7 +12,7 @@ from image_gen_aux import DepthPreprocessor
from PIL import Image from PIL import Image
from nunchaku.models.safety_checker import SafetyChecker from nunchaku.models.safety_checker import SafetyChecker
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku.models.transformers.transformer_flux import NunchakuFluxTransformer2dModel
from utils import get_args from utils import get_args
from vars import ( from vars import (
DEFAULT_GUIDANCE_CANNY, DEFAULT_GUIDANCE_CANNY,
...@@ -57,7 +57,7 @@ else: ...@@ -57,7 +57,7 @@ else:
transformer = NunchakuFluxTransformer2dModel.from_pretrained(f"mit-han-lab/svdq-int4-flux.1-{model_name}") transformer = NunchakuFluxTransformer2dModel.from_pretrained(f"mit-han-lab/svdq-int4-flux.1-{model_name}")
pipeline_init_kwargs["transformer"] = transformer pipeline_init_kwargs["transformer"] = transformer
if args.use_qencoder: if args.use_qencoder:
from nunchaku.models.text_encoder import NunchakuT5EncoderModel from nunchaku.models.text_encoders.t5_encoder import NunchakuT5EncoderModel
text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5") text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5")
pipeline_init_kwargs["text_encoder_2"] = text_encoder_2 pipeline_init_kwargs["text_encoder_2"] = text_encoder_2
......
...@@ -10,7 +10,7 @@ from diffusers import FluxFillPipeline ...@@ -10,7 +10,7 @@ from diffusers import FluxFillPipeline
from PIL import Image from PIL import Image
from nunchaku.models.safety_checker import SafetyChecker from nunchaku.models.safety_checker import SafetyChecker
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku.models.transformers.transformer_flux import NunchakuFluxTransformer2dModel
from utils import get_args from utils import get_args
from vars import DEFAULT_GUIDANCE, DEFAULT_INFERENCE_STEP, DEFAULT_STYLE_NAME, EXAMPLES, MAX_SEED, STYLE_NAMES, STYLES from vars import DEFAULT_GUIDANCE, DEFAULT_INFERENCE_STEP, DEFAULT_STYLE_NAME, EXAMPLES, MAX_SEED, STYLE_NAMES, STYLES
...@@ -29,7 +29,7 @@ else: ...@@ -29,7 +29,7 @@ else:
transformer = NunchakuFluxTransformer2dModel.from_pretrained(f"mit-han-lab/svdq-int4-flux.1-fill-dev") transformer = NunchakuFluxTransformer2dModel.from_pretrained(f"mit-han-lab/svdq-int4-flux.1-fill-dev")
pipeline_init_kwargs["transformer"] = transformer pipeline_init_kwargs["transformer"] = transformer
if args.use_qencoder: if args.use_qencoder:
from nunchaku.models.text_encoder import NunchakuT5EncoderModel from nunchaku.models.text_encoders.t5_encoder import NunchakuT5EncoderModel
text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5") text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5")
pipeline_init_kwargs["text_encoder_2"] = text_encoder_2 pipeline_init_kwargs["text_encoder_2"] = text_encoder_2
......
...@@ -9,7 +9,7 @@ import torch ...@@ -9,7 +9,7 @@ import torch
from diffusers import FluxPipeline, FluxPriorReduxPipeline from diffusers import FluxPipeline, FluxPriorReduxPipeline
from PIL import Image from PIL import Image
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku.models.transformers.transformer_flux import NunchakuFluxTransformer2dModel
from utils import get_args from utils import get_args
from vars import DEFAULT_GUIDANCE, DEFAULT_INFERENCE_STEP, EXAMPLES, MAX_SEED from vars import DEFAULT_GUIDANCE, DEFAULT_INFERENCE_STEP, EXAMPLES, MAX_SEED
......
...@@ -12,7 +12,7 @@ from PIL import Image ...@@ -12,7 +12,7 @@ from PIL import Image
from flux_pix2pix_pipeline import FluxPix2pixTurboPipeline from flux_pix2pix_pipeline import FluxPix2pixTurboPipeline
from nunchaku.models.safety_checker import SafetyChecker from nunchaku.models.safety_checker import SafetyChecker
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku.models.transformers.transformer_flux import NunchakuFluxTransformer2dModel
from utils import get_args from utils import get_args
from vars import DEFAULT_SKETCH_GUIDANCE, DEFAULT_STYLE_NAME, MAX_SEED, STYLE_NAMES, STYLES from vars import DEFAULT_SKETCH_GUIDANCE, DEFAULT_STYLE_NAME, MAX_SEED, STYLE_NAMES, STYLES
...@@ -36,7 +36,7 @@ else: ...@@ -36,7 +36,7 @@ else:
transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-schnell") transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-schnell")
pipeline_init_kwargs["transformer"] = transformer pipeline_init_kwargs["transformer"] = transformer
if args.use_qencoder: if args.use_qencoder:
from nunchaku.models.text_encoder import NunchakuT5EncoderModel from nunchaku.models.text_encoders.t5_encoder import NunchakuT5EncoderModel
text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5") text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5")
pipeline_init_kwargs["text_encoder_2"] = text_encoder_2 pipeline_init_kwargs["text_encoder_2"] = text_encoder_2
......
...@@ -57,7 +57,7 @@ def main(): ...@@ -57,7 +57,7 @@ def main():
for dataset_name in args.datasets: for dataset_name in args.datasets:
output_dirname = os.path.join(output_root, dataset_name) output_dirname = os.path.join(output_root, dataset_name)
os.makedirs(output_dirname, exist_ok=True) os.makedirs(output_dirname, exist_ok=True)
dataset = get_dataset(name=dataset_name) dataset = get_dataset(name=dataset_name, max_dataset_size=8)
if args.chunk_step > 1: if args.chunk_step > 1:
dataset = dataset.select(range(args.chunk_start, len(dataset), args.chunk_step)) dataset = dataset.select(range(args.chunk_start, len(dataset), args.chunk_step))
for row in tqdm(dataset): for row in tqdm(dataset):
......
...@@ -2,7 +2,7 @@ import torch ...@@ -2,7 +2,7 @@ import torch
from diffusers import FluxPipeline from diffusers import FluxPipeline
from peft.tuners import lora from peft.tuners import lora
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku import NunchakuFluxTransformer2dModel
from vars import LORA_PATHS, SVDQ_LORA_PATHS from vars import LORA_PATHS, SVDQ_LORA_PATHS
...@@ -32,11 +32,11 @@ def get_pipeline( ...@@ -32,11 +32,11 @@ def get_pipeline(
else: else:
assert precision == "fp4" assert precision == "fp4"
transformer = NunchakuFluxTransformer2dModel.from_pretrained( transformer = NunchakuFluxTransformer2dModel.from_pretrained(
"/home/muyang/nunchaku_models/flux.1-schnell-nvfp4-svdq-gptq", precision="fp4" "mit-han-lab/svdq-fp4-flux.1-schnell", precision="fp4"
) )
pipeline_init_kwargs["transformer"] = transformer pipeline_init_kwargs["transformer"] = transformer
if use_qencoder: if use_qencoder:
from nunchaku.models.text_encoder import NunchakuT5EncoderModel from nunchaku.models.text_encoders.t5_encoder import NunchakuT5EncoderModel
text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5") text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5")
pipeline_init_kwargs["text_encoder_2"] = text_encoder_2 pipeline_init_kwargs["text_encoder_2"] = text_encoder_2
...@@ -53,7 +53,7 @@ def get_pipeline( ...@@ -53,7 +53,7 @@ def get_pipeline(
transformer.set_lora_strength(lora_weight) transformer.set_lora_strength(lora_weight)
pipeline_init_kwargs["transformer"] = transformer pipeline_init_kwargs["transformer"] = transformer
if use_qencoder: if use_qencoder:
from nunchaku.models.text_encoder import NunchakuT5EncoderModel from nunchaku.models.text_encoders.t5_encoder import NunchakuT5EncoderModel
text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5") text_encoder_2 = NunchakuT5EncoderModel.from_pretrained("mit-han-lab/svdq-flux.1-t5")
pipeline_init_kwargs["text_encoder_2"] = text_encoder_2 pipeline_init_kwargs["text_encoder_2"] = text_encoder_2
......
import torch import torch
from diffusers import SanaPAGPipeline from diffusers import SanaPAGPipeline
from nunchaku.models.transformer_sana import NunchakuSanaTransformer2DModel from nunchaku.models.transformers.transformer_sana import NunchakuSanaTransformer2DModel
def hash_str_to_int(s: str) -> int: def hash_str_to_int(s: str) -> int:
...@@ -30,7 +30,7 @@ def get_pipeline( ...@@ -30,7 +30,7 @@ def get_pipeline(
variant="bf16", variant="bf16",
torch_dtype=torch.bfloat16, torch_dtype=torch.bfloat16,
pag_applied_layers="transformer_blocks.8", pag_applied_layers="transformer_blocks.8",
**pipeline_init_kwargs **pipeline_init_kwargs,
) )
if precision == "int4": if precision == "int4":
pipeline._set_pag_attn_processor = lambda *args, **kwargs: None pipeline._set_pag_attn_processor = lambda *args, **kwargs: None
......
...@@ -70,8 +70,6 @@ comfy node registry-install svdquant ...@@ -70,8 +70,6 @@ comfy node registry-install svdquant
* Install missing nodes (e.g., comfyui-inpainteasy) following [this tutorial](https://github.com/ltdrdata/ComfyUI-Manager?tab=readme-ov-file#support-of-missing-nodes-installation). * Install missing nodes (e.g., comfyui-inpainteasy) following [this tutorial](https://github.com/ltdrdata/ComfyUI-Manager?tab=readme-ov-file#support-of-missing-nodes-installation).
2. **Download Required Models**: Follow [this tutorial](https://comfyanonymous.github.io/ComfyUI_examples/flux/) and download the required models into the appropriate directories using the commands below: 2. **Download Required Models**: Follow [this tutorial](https://comfyanonymous.github.io/ComfyUI_examples/flux/) and download the required models into the appropriate directories using the commands below:
```shell ```shell
...@@ -92,7 +90,7 @@ comfy node registry-install svdquant ...@@ -92,7 +90,7 @@ comfy node registry-install svdquant
* **SVDQuant Flux DiT Loader**: A node for loading the FLUX diffusion model. * **SVDQuant Flux DiT Loader**: A node for loading the FLUX diffusion model.
* `model_path`: Specifies the model location. If set to `mit-han-lab/svdq-int4-flux.1-schnell`, `mit-han-lab/svdq-int4-flux.1-dev`, `mit-han-lab/svdq-int4-flux.1-canny-dev`, `mit-han-lab/svdq-int4-flux.1-fill-dev` or `mit-han-lab/svdq-int4-flux.1-depth-dev`, the model will be automatically downloaded from our Hugging Face repository. Alternatively, you can manually download the model directory by running the following command example: * `model_path`: Specifies the model location. If set to the folder starting with `mit-han-lab`, the model will be automatically downloaded from our Hugging Face repository. Alternatively, you can manually download the model directory by running the following command example:
```shell ```shell
huggingface-cli download mit-han-lab/svdq-int4-flux.1-dev --local-dir models/diffusion_models/svdq-int4-flux.1-dev huggingface-cli download mit-han-lab/svdq-int4-flux.1-dev --local-dir models/diffusion_models/svdq-int4-flux.1-dev
...@@ -100,6 +98,8 @@ comfy node registry-install svdquant ...@@ -100,6 +98,8 @@ comfy node registry-install svdquant
After downloading, specify the corresponding folder name as the `model_path`. After downloading, specify the corresponding folder name as the `model_path`.
* `cpu_offload`: Enables CPU offloading for the transformer model. While this may reduce GPU memory usage, it can slow down inference. Memory usage will be further optimized in node v0.1.6.
* `device_id`: Indicates the GPU ID for running the model. * `device_id`: Indicates the GPU ID for running the model.
* **SVDQuant FLUX LoRA Loader**: A node for loading LoRA modules for SVDQuant FLUX models. * **SVDQuant FLUX LoRA Loader**: A node for loading LoRA modules for SVDQuant FLUX models.
......
...@@ -4,10 +4,7 @@ import tempfile ...@@ -4,10 +4,7 @@ import tempfile
import folder_paths import folder_paths
from safetensors.torch import save_file from safetensors.torch import save_file
from nunchaku.lora.flux.comfyui_converter import comfyui2diffusers from nunchaku.lora.flux import comfyui2diffusers, convert_to_nunchaku_flux_lowrank_dict, detect_format, xlab2diffusers
from nunchaku.lora.flux.diffusers_converter import convert_to_nunchaku_flux_lowrank_dict
from nunchaku.lora.flux.utils import detect_format
from nunchaku.lora.flux.xlab_converter import xlab2diffusers
class SVDQuantFluxLoraLoader: class SVDQuantFluxLoraLoader:
...@@ -25,6 +22,8 @@ class SVDQuantFluxLoraLoader: ...@@ -25,6 +22,8 @@ class SVDQuantFluxLoraLoader:
base_model_paths = [ base_model_paths = [
"mit-han-lab/svdq-int4-flux.1-dev", "mit-han-lab/svdq-int4-flux.1-dev",
"mit-han-lab/svdq-int4-flux.1-schnell", "mit-han-lab/svdq-int4-flux.1-schnell",
"mit-han-lab/svdq-fp4-flux.1-dev",
"mit-han-lab/svdq-fp4-flux.1-schnell",
"mit-han-lab/svdq-int4-flux.1-canny-dev", "mit-han-lab/svdq-int4-flux.1-canny-dev",
"mit-han-lab/svdq-int4-flux.1-depth-dev", "mit-han-lab/svdq-int4-flux.1-depth-dev",
"mit-han-lab/svdq-int4-flux.1-fill-dev", "mit-han-lab/svdq-int4-flux.1-fill-dev",
......
...@@ -10,7 +10,7 @@ from diffusers import FluxTransformer2DModel ...@@ -10,7 +10,7 @@ from diffusers import FluxTransformer2DModel
from einops import rearrange, repeat from einops import rearrange, repeat
from torch import nn from torch import nn
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku import NunchakuFluxTransformer2dModel
class ComfyUIFluxForwardWrapper(nn.Module): class ComfyUIFluxForwardWrapper(nn.Module):
...@@ -67,31 +67,53 @@ class ComfyUIFluxForwardWrapper(nn.Module): ...@@ -67,31 +67,53 @@ class ComfyUIFluxForwardWrapper(nn.Module):
class SVDQuantFluxDiTLoader: class SVDQuantFluxDiTLoader:
@classmethod @classmethod
def INPUT_TYPES(s): def INPUT_TYPES(s):
# folder_paths.get_filename_list("loras"),
model_paths = [ model_paths = [
"mit-han-lab/svdq-int4-flux.1-schnell", "mit-han-lab/svdq-int4-flux.1-schnell",
"mit-han-lab/svdq-int4-flux.1-dev", "mit-han-lab/svdq-int4-flux.1-dev",
"mit-han-lab/svdq-fp4-flux.1-schnell",
"mit-han-lab/svdq-fp4-flux.1-dev",
"mit-han-lab/svdq-int4-flux.1-canny-dev", "mit-han-lab/svdq-int4-flux.1-canny-dev",
"mit-han-lab/svdq-int4-flux.1-depth-dev", "mit-han-lab/svdq-int4-flux.1-depth-dev",
"mit-han-lab/svdq-int4-flux.1-fill-dev", "mit-han-lab/svdq-int4-flux.1-fill-dev",
] ]
prefix = os.path.join(folder_paths.models_dir, "diffusion_models") prefixes = folder_paths.folder_names_and_paths["diffusion_models"][0]
local_folders = os.listdir(prefix) local_folders = set()
local_folders = sorted( for prefix in prefixes:
[ if os.path.exists(prefix) and os.path.isdir(prefix):
folder local_folders_ = os.listdir(prefix)
for folder in local_folders local_folders_ = [
if not folder.startswith(".") and os.path.isdir(os.path.join(prefix, folder)) folder
] for folder in local_folders_
) if not folder.startswith(".") and os.path.isdir(os.path.join(prefix, folder))
]
local_folders.update(local_folders_)
local_folders = sorted(list(local_folders))
model_paths = local_folders + model_paths model_paths = local_folders + model_paths
ngpus = len(GPUtil.getGPUs()) ngpus = len(GPUtil.getGPUs())
return { return {
"required": { "required": {
"model_path": (model_paths,), "model_path": (
model_paths,
{"tooltip": "The SVDQuant quantized FLUX.1 models. It can be a huggingface path or a local path."},
),
"cpu_offload": (
["enable", "disable"],
{
"default": "disable",
"tooltip": "Whether to enable CPU offload for the transformer model. This may slow down the inference, but may reduce the GPU memory usage.",
},
),
"device_id": ( "device_id": (
"INT", "INT",
{"default": 0, "min": 0, "max": ngpus, "step": 1, "display": "number", "lazy": True}, {
"default": 0,
"min": 0,
"max": ngpus,
"step": 1,
"display": "number",
"lazy": True,
"tooltip": "The GPU device ID to use for the model.",
},
), ),
} }
} }
...@@ -101,14 +123,15 @@ class SVDQuantFluxDiTLoader: ...@@ -101,14 +123,15 @@ class SVDQuantFluxDiTLoader:
CATEGORY = "SVDQuant" CATEGORY = "SVDQuant"
TITLE = "SVDQuant Flux DiT Loader" TITLE = "SVDQuant Flux DiT Loader"
def load_model(self, model_path: str, device_id: int, **kwargs) -> tuple[FluxTransformer2DModel]: def load_model(self, model_path: str, cpu_offload: str, device_id: int, **kwargs) -> tuple[FluxTransformer2DModel]:
device = f"cuda:{device_id}" device = f"cuda:{device_id}"
prefix = os.path.join(folder_paths.models_dir, "diffusion_models") prefixes = folder_paths.folder_names_and_paths["diffusion_models"][0]
if os.path.exists(os.path.join(prefix, model_path)): for prefix in prefixes:
model_path = os.path.join(prefix, model_path) if os.path.exists(os.path.join(prefix, model_path)):
else: model_path = os.path.join(prefix, model_path)
model_path = model_path break
transformer = NunchakuFluxTransformer2dModel.from_pretrained(model_path).to(device) transformer = NunchakuFluxTransformer2dModel.from_pretrained(model_path, offload=cpu_offload == "enable")
transformer = transformer.to(device)
dit_config = { dit_config = {
"image_model": "flux", "image_model": "flux",
"patch_size": 2, "patch_size": 2,
......
...@@ -4,39 +4,60 @@ import types ...@@ -4,39 +4,60 @@ import types
import comfy.sd import comfy.sd
import folder_paths import folder_paths
import torch import torch
from torch import nn
from transformers import T5EncoderModel from transformers import T5EncoderModel
from nunchaku import NunchakuT5EncoderModel
def svdquant_t5_forward( def svdquant_t5_forward(
self: T5EncoderModel, self: T5EncoderModel,
input_ids: torch.LongTensor, input_ids: torch.LongTensor,
attention_mask, attention_mask,
embeds=None,
intermediate_output=None, intermediate_output=None,
final_layer_norm_intermediate=True, final_layer_norm_intermediate=True,
dtype: str | torch.dtype = torch.bfloat16, dtype: str | torch.dtype = torch.bfloat16,
**kwargs,
): ):
assert attention_mask is None assert attention_mask is None
assert intermediate_output is None assert intermediate_output is None
assert final_layer_norm_intermediate assert final_layer_norm_intermediate
outputs = self.encoder(input_ids, attention_mask=attention_mask) outputs = self.encoder(input_ids=input_ids, inputs_embeds=embeds, attention_mask=attention_mask)
hidden_states = outputs["last_hidden_state"] hidden_states = outputs["last_hidden_state"]
hidden_states = hidden_states.to(dtype=dtype) hidden_states = hidden_states.to(dtype=dtype)
return hidden_states, None return hidden_states, None
class WrappedEmbedding(nn.Module):
def __init__(self, embedding: nn.Embedding):
super().__init__()
self.embedding = embedding
def forward(self, input: torch.Tensor, out_dtype: torch.dtype | None = None):
return self.embedding(input)
@property
def weight(self):
return self.embedding.weight
class SVDQuantTextEncoderLoader: class SVDQuantTextEncoderLoader:
@classmethod @classmethod
def INPUT_TYPES(s): def INPUT_TYPES(s):
model_paths = ["mit-han-lab/svdq-flux.1-t5"] model_paths = ["mit-han-lab/svdq-flux.1-t5"]
prefix = os.path.join(folder_paths.models_dir, "text_encoders") prefixes = folder_paths.folder_names_and_paths["text_encoders"][0]
local_folders = os.listdir(prefix) local_folders = set()
local_folders = sorted( for prefix in prefixes:
[ if os.path.exists(prefix) and os.path.isdir(prefix):
folder local_folders_ = os.listdir(prefix)
for folder in local_folders local_folders_ = [
if not folder.startswith(".") and os.path.isdir(os.path.join(prefix, folder)) folder
] for folder in local_folders_
) if not folder.startswith(".") and os.path.isdir(os.path.join(prefix, folder))
]
local_folders.update(local_folders_)
local_folders = sorted(list(local_folders))
model_paths.extend(local_folders) model_paths.extend(local_folders)
return { return {
"required": { "required": {
...@@ -45,14 +66,7 @@ class SVDQuantTextEncoderLoader: ...@@ -45,14 +66,7 @@ class SVDQuantTextEncoderLoader:
"text_encoder2": (folder_paths.get_filename_list("text_encoders"),), "text_encoder2": (folder_paths.get_filename_list("text_encoders"),),
"t5_min_length": ( "t5_min_length": (
"INT", "INT",
{ {"default": 512, "min": 256, "max": 1024, "step": 128, "display": "number", "lazy": True},
"default": 512,
"min": 256,
"max": 1024,
"step": 128,
"display": "number",
"lazy": True,
},
), ),
"t5_precision": (["BF16", "INT4"],), "t5_precision": (["BF16", "INT4"],),
"int4_model": (model_paths, {"tooltip": "The name of the INT4 model."}), "int4_model": (model_paths, {"tooltip": "The name of the INT4 model."}),
...@@ -92,20 +106,23 @@ class SVDQuantTextEncoderLoader: ...@@ -92,20 +106,23 @@ class SVDQuantTextEncoderLoader:
clip.tokenizer.t5xxl.min_length = t5_min_length clip.tokenizer.t5xxl.min_length = t5_min_length
if t5_precision == "INT4": if t5_precision == "INT4":
from nunchaku.models.text_encoder import NunchakuT5EncoderModel
transformer = clip.cond_stage_model.t5xxl.transformer transformer = clip.cond_stage_model.t5xxl.transformer
param = next(transformer.parameters()) param = next(transformer.parameters())
dtype = param.dtype dtype = param.dtype
device = param.device device = param.device
prefix = "models/text_encoders" prefixes = folder_paths.folder_names_and_paths["diffusion_models"][0]
if os.path.exists(os.path.join(prefix, int4_model)): model_path = None
model_path = os.path.join(prefix, int4_model) for prefix in prefixes:
else: if os.path.exists(os.path.join(prefix, int4_model)):
model_path = os.path.join(prefix, int4_model)
break
if model_path is None:
model_path = int4_model model_path = int4_model
transformer = NunchakuT5EncoderModel.from_pretrained(model_path) transformer = NunchakuT5EncoderModel.from_pretrained(model_path)
transformer.forward = types.MethodType(svdquant_t5_forward, transformer) transformer.forward = types.MethodType(svdquant_t5_forward, transformer)
transformer.shared = WrappedEmbedding(transformer.shared)
clip.cond_stage_model.t5xxl.transformer = ( clip.cond_stage_model.t5xxl.transformer = (
transformer.to(device=device, dtype=dtype) if device.type == "cuda" else transformer transformer.to(device=device, dtype=dtype) if device.type == "cuda" else transformer
) )
......
[project] [project]
name = "svdquant" name = "svdquant"
description = "SVDQuant ComfyUI Node. SVDQuant is a new post-training training quantization paradigm for diffusion models, which quantize both the weights and activations of FLUX.1 to 4 bits, achieving 3.5× memory and 8.7× latency reduction on a 16GB laptop 4090 GPU." description = "SVDQuant ComfyUI Node. SVDQuant is a new post-training training quantization paradigm for diffusion models, which quantize both the weights and activations of FLUX.1 to 4 bits, achieving 3.5× memory and 8.7× latency reduction on a 16GB laptop 4090 GPU. GitHub: https://github.com/mit-han-lab/nunchaku"
version = "0.1.3" version = "0.1.5"
license = { file = "LICENSE.txt" } license = { file = "LICENSE.txt" }
dependencies = [] dependencies = []
requires-python = ">=3.11, <3.13" requires-python = ">=3.10, <3.13"
[project.urls] #[project.urls]
Repository = "https://github.com/mit-han-lab/nunchaku" #Repository = "https://github.com/mit-han-lab/nunchaku"
# Used by Comfy Registry https://comfyregistry.org # Used by Comfy Registry https://comfyregistry.org
[tool.comfy] [tool.comfy]
......
...@@ -19,45 +19,50 @@ ...@@ -19,45 +19,50 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"label": "model",
"type": "MODEL", "type": "MODEL",
"link": 71, "link": 71
"label": "model"
}, },
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"label": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 64, "link": 64
"label": "positive"
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"label": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 65, "link": 65
"label": "negative"
}, },
{ {
"name": "latent_image", "name": "latent_image",
"localized_name": "latent_image",
"label": "latent_image",
"type": "LATENT", "type": "LATENT",
"link": 66, "link": 66
"label": "latent_image"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "LATENT", "name": "LATENT",
"localized_name": "LATENT",
"label": "LATENT",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
7 7
], ],
"slot_index": 0, "slot_index": 0
"label": "LATENT"
} }
], ],
"properties": { "properties": {
"Node name for S&R": "KSampler" "Node name for S&R": "KSampler"
}, },
"widgets_values": [ "widgets_values": [
896617285614695, 875054580097021,
"randomize", "randomize",
20, 20,
1, 1,
...@@ -83,56 +88,63 @@ ...@@ -83,56 +88,63 @@
"inputs": [ "inputs": [
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"label": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 67, "link": 67
"label": "positive"
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"label": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 68, "link": 68
"label": "negative"
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"label": "vae",
"type": "VAE", "type": "VAE",
"link": 69, "link": 69
"label": "vae"
}, },
{ {
"name": "pixels", "name": "pixels",
"localized_name": "pixels",
"label": "pixels",
"type": "IMAGE", "type": "IMAGE",
"link": 70, "link": 70
"label": "pixels"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"label": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
64 64
], ],
"slot_index": 0, "slot_index": 0
"label": "positive"
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"label": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
65 65
], ],
"slot_index": 1, "slot_index": 1
"label": "negative"
}, },
{ {
"name": "latent", "name": "latent",
"localized_name": "latent",
"label": "latent",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
66 66
], ],
"slot_index": 2, "slot_index": 2
"label": "latent"
} }
], ],
"properties": { "properties": {
...@@ -157,26 +169,29 @@ ...@@ -157,26 +169,29 @@
"inputs": [ "inputs": [
{ {
"name": "samples", "name": "samples",
"localized_name": "samples",
"label": "samples",
"type": "LATENT", "type": "LATENT",
"link": 7, "link": 7
"label": "samples"
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"label": "vae",
"type": "VAE", "type": "VAE",
"link": 60, "link": 60
"label": "vae"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"label": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
9 9
], ],
"slot_index": 0, "slot_index": 0
"label": "IMAGE"
} }
], ],
"properties": { "properties": {
...@@ -201,9 +216,10 @@ ...@@ -201,9 +216,10 @@
"inputs": [ "inputs": [
{ {
"name": "images", "name": "images",
"localized_name": "images",
"label": "images",
"type": "IMAGE", "type": "IMAGE",
"link": 9, "link": 9
"label": "images"
} }
], ],
"outputs": [], "outputs": [],
...@@ -230,13 +246,14 @@ ...@@ -230,13 +246,14 @@
"outputs": [ "outputs": [
{ {
"name": "VAE", "name": "VAE",
"localized_name": "VAE",
"label": "VAE",
"type": "VAE", "type": "VAE",
"links": [ "links": [
60, 60,
69 69
], ],
"slot_index": 0, "slot_index": 0
"label": "VAE"
} }
], ],
"properties": { "properties": {
...@@ -263,21 +280,23 @@ ...@@ -263,21 +280,23 @@
"inputs": [ "inputs": [
{ {
"name": "conditioning", "name": "conditioning",
"localized_name": "conditioning",
"label": "conditioning",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 41, "link": 41
"label": "conditioning"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"label": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"shape": 3,
"links": [ "links": [
67 67
], ],
"slot_index": 0, "slot_index": 0
"shape": 3,
"label": "CONDITIONING"
} }
], ],
"properties": { "properties": {
...@@ -296,7 +315,7 @@ ...@@ -296,7 +315,7 @@
], ],
"size": [ "size": [
315, 315,
106 122
], ],
"flags": {}, "flags": {},
"order": 1, "order": 1,
...@@ -305,12 +324,13 @@ ...@@ -305,12 +324,13 @@
"outputs": [ "outputs": [
{ {
"name": "CLIP", "name": "CLIP",
"localized_name": "CLIP",
"label": "CLIP",
"type": "CLIP", "type": "CLIP",
"links": [ "links": [
62, 62,
63 63
], ]
"label": "CLIP"
} }
], ],
"properties": { "properties": {
...@@ -340,20 +360,22 @@ ...@@ -340,20 +360,22 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"label": "clip",
"type": "CLIP", "type": "CLIP",
"link": 62, "link": 62
"label": "clip"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"label": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
41 41
], ],
"slot_index": 0, "slot_index": 0
"label": "CONDITIONING"
} }
], ],
"title": "CLIP Text Encode (Positive Prompt)", "title": "CLIP Text Encode (Positive Prompt)",
...@@ -383,9 +405,10 @@ ...@@ -383,9 +405,10 @@
"inputs": [ "inputs": [
{ {
"name": "images", "name": "images",
"localized_name": "images",
"label": "images",
"type": "IMAGE", "type": "IMAGE",
"link": 26, "link": 26
"label": "images"
} }
], ],
"outputs": [], "outputs": [],
...@@ -411,22 +434,24 @@ ...@@ -411,22 +434,24 @@
"inputs": [ "inputs": [
{ {
"name": "image", "name": "image",
"localized_name": "image",
"label": "image",
"type": "IMAGE", "type": "IMAGE",
"link": 76, "link": 76
"label": "image"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"label": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"shape": 3,
"links": [ "links": [
26, 26,
70 70
], ],
"slot_index": 0, "slot_index": 0
"shape": 3,
"label": "IMAGE"
} }
], ],
"properties": { "properties": {
...@@ -454,6 +479,7 @@ ...@@ -454,6 +479,7 @@
"inputs": [ "inputs": [
{ {
"name": "image", "name": "image",
"localized_name": "image",
"type": "IMAGE", "type": "IMAGE",
"link": 75 "link": 75
} }
...@@ -461,6 +487,7 @@ ...@@ -461,6 +487,7 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
76 76
...@@ -478,48 +505,6 @@ ...@@ -478,48 +505,6 @@
"center" "center"
] ]
}, },
{
"id": 17,
"type": "LoadImage",
"pos": [
6.694743633270264,
562.3865966796875
],
"size": [
315,
314.0000305175781
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
75
],
"slot_index": 0,
"shape": 3,
"label": "IMAGE"
},
{
"name": "MASK",
"type": "MASK",
"links": null,
"shape": 3,
"label": "MASK"
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"robot.png",
"image"
]
},
{ {
"id": 7, "id": 7,
"type": "CLIPTextEncode", "type": "CLIPTextEncode",
...@@ -539,20 +524,22 @@ ...@@ -539,20 +524,22 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"label": "clip",
"type": "CLIP", "type": "CLIP",
"link": 63, "link": 63
"label": "clip"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"label": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
68 68
], ],
"slot_index": 0, "slot_index": 0
"label": "CONDITIONING"
} }
], ],
"title": "CLIP Text Encode (Negative Prompt)", "title": "CLIP Text Encode (Negative Prompt)",
...@@ -565,6 +552,50 @@ ...@@ -565,6 +552,50 @@
"color": "#322", "color": "#322",
"bgcolor": "#533" "bgcolor": "#533"
}, },
{
"id": 17,
"type": "LoadImage",
"pos": [
6.694743633270264,
562.3865966796875
],
"size": [
315,
314.0000305175781
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"localized_name": "IMAGE",
"label": "IMAGE",
"type": "IMAGE",
"shape": 3,
"links": [
75
],
"slot_index": 0
},
{
"name": "MASK",
"localized_name": "MASK",
"label": "MASK",
"type": "MASK",
"shape": 3,
"links": null
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"robot.png",
"image"
]
},
{ {
"id": 36, "id": 36,
"type": "SVDQuantFluxDiTLoader", "type": "SVDQuantFluxDiTLoader",
...@@ -574,7 +605,7 @@ ...@@ -574,7 +605,7 @@
], ],
"size": [ "size": [
395.6002197265625, 395.6002197265625,
105.77959442138672 106
], ],
"flags": {}, "flags": {},
"order": 3, "order": 3,
...@@ -583,6 +614,7 @@ ...@@ -583,6 +614,7 @@
"outputs": [ "outputs": [
{ {
"name": "MODEL", "name": "MODEL",
"localized_name": "MODEL",
"type": "MODEL", "type": "MODEL",
"links": [ "links": [
71 71
...@@ -595,6 +627,7 @@ ...@@ -595,6 +627,7 @@
}, },
"widgets_values": [ "widgets_values": [
"mit-han-lab/svdq-int4-flux.1-canny-dev", "mit-han-lab/svdq-int4-flux.1-canny-dev",
"disable",
0 0
] ]
} }
...@@ -741,14 +774,14 @@ ...@@ -741,14 +774,14 @@
"config": {}, "config": {},
"extra": { "extra": {
"ds": { "ds": {
"scale": 0.895430243255241, "scale": 1.5863092971714992,
"offset": [ "offset": [
838.4305404853558, 170.04223120944968,
332.05158795287764 209.5374167314878
] ]
}, },
"node_versions": { "node_versions": {
"comfy-core": "0.3.14" "comfy-core": "0.3.24"
} }
}, },
"version": 0.4 "version": 0.4
......
...@@ -21,20 +21,22 @@ ...@@ -21,20 +21,22 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"label": "clip",
"type": "CLIP", "type": "CLIP",
"link": 63, "link": 63
"label": "clip"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"label": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
68 68
], ],
"slot_index": 0, "slot_index": 0
"label": "CONDITIONING"
} }
], ],
"title": "CLIP Text Encode (Negative Prompt)", "title": "CLIP Text Encode (Negative Prompt)",
...@@ -56,7 +58,7 @@ ...@@ -56,7 +58,7 @@
], ],
"size": [ "size": [
315, 315,
106 122
], ],
"flags": {}, "flags": {},
"order": 0, "order": 0,
...@@ -65,12 +67,13 @@ ...@@ -65,12 +67,13 @@
"outputs": [ "outputs": [
{ {
"name": "CLIP", "name": "CLIP",
"localized_name": "CLIP",
"label": "CLIP",
"type": "CLIP", "type": "CLIP",
"links": [ "links": [
62, 62,
63 63
], ]
"label": "CLIP"
} }
], ],
"properties": { "properties": {
...@@ -100,21 +103,23 @@ ...@@ -100,21 +103,23 @@
"inputs": [ "inputs": [
{ {
"name": "conditioning", "name": "conditioning",
"localized_name": "conditioning",
"label": "conditioning",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 41, "link": 41
"label": "conditioning"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"label": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"shape": 3,
"links": [ "links": [
67 67
], ],
"slot_index": 0, "slot_index": 0
"shape": 3,
"label": "CONDITIONING"
} }
], ],
"properties": { "properties": {
...@@ -141,45 +146,50 @@ ...@@ -141,45 +146,50 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"label": "model",
"type": "MODEL", "type": "MODEL",
"link": 78, "link": 78
"label": "model"
}, },
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"label": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 64, "link": 64
"label": "positive"
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"label": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 65, "link": 65
"label": "negative"
}, },
{ {
"name": "latent_image", "name": "latent_image",
"localized_name": "latent_image",
"label": "latent_image",
"type": "LATENT", "type": "LATENT",
"link": 73, "link": 73
"label": "latent_image"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "LATENT", "name": "LATENT",
"localized_name": "LATENT",
"label": "LATENT",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
7 7
], ],
"slot_index": 0, "slot_index": 0
"label": "LATENT"
} }
], ],
"properties": { "properties": {
"Node name for S&R": "KSampler" "Node name for S&R": "KSampler"
}, },
"widgets_values": [ "widgets_values": [
704308966490490, 69796511068157,
"randomize", "randomize",
20, 20,
1, 1,
...@@ -188,39 +198,6 @@ ...@@ -188,39 +198,6 @@
1 1
] ]
}, },
{
"id": 39,
"type": "SVDQuantFluxDiTLoader",
"pos": [
707.80908203125,
-172.0343017578125
],
"size": [
315,
82
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
78
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader"
},
"widgets_values": [
"mit-han-lab/svdq-int4-flux.1-depth-dev",
0
]
},
{ {
"id": 43, "id": 43,
"type": "PreviewImage", "type": "PreviewImage",
...@@ -238,9 +215,10 @@ ...@@ -238,9 +215,10 @@
"inputs": [ "inputs": [
{ {
"name": "images", "name": "images",
"localized_name": "images",
"label": "images",
"type": "IMAGE", "type": "IMAGE",
"link": 87, "link": 87
"label": "images"
} }
], ],
"outputs": [], "outputs": [],
...@@ -266,26 +244,29 @@ ...@@ -266,26 +244,29 @@
"inputs": [ "inputs": [
{ {
"name": "samples", "name": "samples",
"localized_name": "samples",
"label": "samples",
"type": "LATENT", "type": "LATENT",
"link": 7, "link": 7
"label": "samples"
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"label": "vae",
"type": "VAE", "type": "VAE",
"link": 60, "link": 60
"label": "vae"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"label": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
85 85
], ],
"slot_index": 0, "slot_index": 0
"label": "IMAGE"
} }
], ],
"properties": { "properties": {
...@@ -310,9 +291,10 @@ ...@@ -310,9 +291,10 @@
"inputs": [ "inputs": [
{ {
"name": "images", "name": "images",
"localized_name": "images",
"label": "images",
"type": "IMAGE", "type": "IMAGE",
"link": 85, "link": 85
"label": "images"
} }
], ],
"outputs": [], "outputs": [],
...@@ -338,6 +320,7 @@ ...@@ -338,6 +320,7 @@
"inputs": [ "inputs": [
{ {
"name": "image", "name": "image",
"localized_name": "image",
"type": "IMAGE", "type": "IMAGE",
"link": 82 "link": 82
} }
...@@ -345,6 +328,7 @@ ...@@ -345,6 +328,7 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
86 86
...@@ -379,20 +363,22 @@ ...@@ -379,20 +363,22 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"label": "clip",
"type": "CLIP", "type": "CLIP",
"link": 62, "link": 62
"label": "clip"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"label": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
41 41
], ],
"slot_index": 0, "slot_index": 0
"label": "CONDITIONING"
} }
], ],
"title": "CLIP Text Encode (Positive Prompt)", "title": "CLIP Text Encode (Positive Prompt)",
...@@ -417,19 +403,20 @@ ...@@ -417,19 +403,20 @@
58 58
], ],
"flags": {}, "flags": {},
"order": 2, "order": 1,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "VAE", "name": "VAE",
"localized_name": "VAE",
"label": "VAE",
"type": "VAE", "type": "VAE",
"links": [ "links": [
60, 60,
69 69
], ],
"slot_index": 0, "slot_index": 0
"label": "VAE"
} }
], ],
"properties": { "properties": {
...@@ -456,56 +443,63 @@ ...@@ -456,56 +443,63 @@
"inputs": [ "inputs": [
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"label": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 67, "link": 67
"label": "positive"
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"label": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 68, "link": 68
"label": "negative"
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"label": "vae",
"type": "VAE", "type": "VAE",
"link": 69, "link": 69
"label": "vae"
}, },
{ {
"name": "pixels", "name": "pixels",
"localized_name": "pixels",
"label": "pixels",
"type": "IMAGE", "type": "IMAGE",
"link": 88, "link": 88
"label": "pixels"
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"label": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
64 64
], ],
"slot_index": 0, "slot_index": 0
"label": "positive"
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"label": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
65 65
], ],
"slot_index": 1, "slot_index": 1
"label": "negative"
}, },
{ {
"name": "latent", "name": "latent",
"localized_name": "latent",
"label": "latent",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
73 73
], ],
"slot_index": 2, "slot_index": 2
"label": "latent"
} }
], ],
"properties": { "properties": {
...@@ -530,6 +524,7 @@ ...@@ -530,6 +524,7 @@
"inputs": [ "inputs": [
{ {
"name": "image", "name": "image",
"localized_name": "image",
"type": "IMAGE", "type": "IMAGE",
"link": 86 "link": 86
} }
...@@ -537,6 +532,7 @@ ...@@ -537,6 +532,7 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
87, 87,
...@@ -564,26 +560,28 @@ ...@@ -564,26 +560,28 @@
314.0000305175781 314.0000305175781
], ],
"flags": {}, "flags": {},
"order": 3, "order": 2,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"label": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"shape": 3,
"links": [ "links": [
82 82
], ],
"slot_index": 0, "slot_index": 0
"shape": 3,
"label": "IMAGE"
}, },
{ {
"name": "MASK", "name": "MASK",
"localized_name": "MASK",
"label": "MASK",
"type": "MASK", "type": "MASK",
"links": null,
"shape": 3, "shape": 3,
"label": "MASK" "links": null
} }
], ],
"properties": { "properties": {
...@@ -593,6 +591,41 @@ ...@@ -593,6 +591,41 @@
"logo_example.png", "logo_example.png",
"image" "image"
] ]
},
{
"id": 39,
"type": "SVDQuantFluxDiTLoader",
"pos": [
707.80908203125,
-172.0343017578125
],
"size": [
315,
106
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"localized_name": "MODEL",
"type": "MODEL",
"links": [
78
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader"
},
"widgets_values": [
"mit-han-lab/svdq-int4-flux.1-depth-dev",
"disable",
0
]
} }
], ],
"links": [ "links": [
...@@ -739,12 +772,12 @@ ...@@ -739,12 +772,12 @@
"ds": { "ds": {
"scale": 0.8140274938684042, "scale": 0.8140274938684042,
"offset": [ "offset": [
1060.3416359459316, 1795.999020278545,
529.8567933439979 750.1636967541119
] ]
}, },
"node_versions": { "node_versions": {
"comfy-core": "0.3.14" "comfy-core": "0.3.24"
} }
}, },
"version": 0.4 "version": 0.4
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"inputs": [ "inputs": [
{ {
"name": "conditioning", "name": "conditioning",
"localized_name": "conditioning",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 41 "link": 41
} }
...@@ -26,12 +27,13 @@ ...@@ -26,12 +27,13 @@
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"shape": 3,
"links": [ "links": [
42 42
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -60,6 +62,7 @@ ...@@ -60,6 +62,7 @@
"inputs": [ "inputs": [
{ {
"name": "images", "name": "images",
"localized_name": "images",
"type": "IMAGE", "type": "IMAGE",
"link": 9 "link": 9
} }
...@@ -82,24 +85,25 @@ ...@@ -82,24 +85,25 @@
82 82
], ],
"flags": {}, "flags": {},
"order": 6, "order": 0,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "NOISE", "name": "NOISE",
"localized_name": "NOISE",
"type": "NOISE", "type": "NOISE",
"shape": 3,
"links": [ "links": [
37 37
], ]
"shape": 3
} }
], ],
"properties": { "properties": {
"Node name for S&R": "RandomNoise" "Node name for S&R": "RandomNoise"
}, },
"widgets_values": [ "widgets_values": [
148576770035090, 385675283593224,
"randomize" "randomize"
], ],
"color": "#2a363b", "color": "#2a363b",
...@@ -117,17 +121,18 @@ ...@@ -117,17 +121,18 @@
58 58
], ],
"flags": {}, "flags": {},
"order": 0, "order": 1,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "SAMPLER", "name": "SAMPLER",
"localized_name": "SAMPLER",
"type": "SAMPLER", "type": "SAMPLER",
"shape": 3,
"links": [ "links": [
19 19
], ]
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -154,6 +159,7 @@ ...@@ -154,6 +159,7 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 55, "link": 55,
"slot_index": 0 "slot_index": 0
...@@ -162,11 +168,12 @@ ...@@ -162,11 +168,12 @@
"outputs": [ "outputs": [
{ {
"name": "SIGMAS", "name": "SIGMAS",
"localized_name": "SIGMAS",
"type": "SIGMAS", "type": "SIGMAS",
"shape": 3,
"links": [ "links": [
20 20
], ]
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -187,7 +194,7 @@ ...@@ -187,7 +194,7 @@
], ],
"size": [ "size": [
315, 315,
130 170
], ],
"flags": {}, "flags": {},
"order": 11, "order": 11,
...@@ -195,6 +202,7 @@ ...@@ -195,6 +202,7 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 123, "link": 123,
"slot_index": 0 "slot_index": 0
...@@ -202,32 +210,41 @@ ...@@ -202,32 +210,41 @@
{ {
"name": "width", "name": "width",
"type": "INT", "type": "INT",
"link": 115, "pos": [
"slot_index": 1, 10,
84
],
"widget": { "widget": {
"name": "width" "name": "width"
} },
"link": 115,
"slot_index": 1
}, },
{ {
"name": "height", "name": "height",
"type": "INT", "type": "INT",
"link": 114, "pos": [
"slot_index": 2, 10,
108
],
"widget": { "widget": {
"name": "height" "name": "height"
} },
"link": 114,
"slot_index": 2
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "MODEL", "name": "MODEL",
"localized_name": "MODEL",
"type": "MODEL", "type": "MODEL",
"shape": 3,
"links": [ "links": [
54, 54,
55 55
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -257,11 +274,13 @@ ...@@ -257,11 +274,13 @@
"inputs": [ "inputs": [
{ {
"name": "samples", "name": "samples",
"localized_name": "samples",
"type": "LATENT", "type": "LATENT",
"link": 24 "link": 24
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"type": "VAE", "type": "VAE",
"link": 12 "link": 12
} }
...@@ -269,6 +288,7 @@ ...@@ -269,6 +288,7 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
9 9
...@@ -298,12 +318,14 @@ ...@@ -298,12 +318,14 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 54, "link": 54,
"slot_index": 0 "slot_index": 0
}, },
{ {
"name": "conditioning", "name": "conditioning",
"localized_name": "conditioning",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 42, "link": 42,
"slot_index": 1 "slot_index": 1
...@@ -312,12 +334,13 @@ ...@@ -312,12 +334,13 @@
"outputs": [ "outputs": [
{ {
"name": "GUIDER", "name": "GUIDER",
"localized_name": "GUIDER",
"type": "GUIDER", "type": "GUIDER",
"shape": 3,
"links": [ "links": [
30 30
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -344,14 +367,14 @@ ...@@ -344,14 +367,14 @@
{ {
"name": "INT", "name": "INT",
"type": "INT", "type": "INT",
"widget": {
"name": "height"
},
"links": [ "links": [
113, 113,
114 114
], ],
"slot_index": 0, "slot_index": 0
"widget": {
"name": "height"
}
} }
], ],
"title": "height", "title": "height",
...@@ -377,21 +400,21 @@ ...@@ -377,21 +400,21 @@
82 82
], ],
"flags": {}, "flags": {},
"order": 1, "order": 3,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "INT", "name": "INT",
"type": "INT", "type": "INT",
"widget": {
"name": "width"
},
"links": [ "links": [
112, 112,
115 115
], ],
"slot_index": 0, "slot_index": 0
"widget": {
"name": "width"
}
} }
], ],
"title": "width", "title": "width",
...@@ -414,7 +437,7 @@ ...@@ -414,7 +437,7 @@
], ],
"size": [ "size": [
315, 315,
106 126
], ],
"flags": {}, "flags": {},
"order": 7, "order": 7,
...@@ -423,29 +446,38 @@ ...@@ -423,29 +446,38 @@
{ {
"name": "width", "name": "width",
"type": "INT", "type": "INT",
"link": 112, "pos": [
10,
36
],
"widget": { "widget": {
"name": "width" "name": "width"
} },
"link": 112
}, },
{ {
"name": "height", "name": "height",
"type": "INT", "type": "INT",
"link": 113, "pos": [
10,
60
],
"widget": { "widget": {
"name": "height" "name": "height"
} },
"link": 113
} }
], ],
"outputs": [ "outputs": [
{ {
"name": "LATENT", "name": "LATENT",
"localized_name": "LATENT",
"type": "LATENT", "type": "LATENT",
"shape": 3,
"links": [ "links": [
116 116
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -474,6 +506,7 @@ ...@@ -474,6 +506,7 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"type": "CLIP", "type": "CLIP",
"link": 118 "link": 118
} }
...@@ -481,6 +514,7 @@ ...@@ -481,6 +514,7 @@
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
41 41
...@@ -515,6 +549,7 @@ ...@@ -515,6 +549,7 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 122 "link": 122
} }
...@@ -522,6 +557,7 @@ ...@@ -522,6 +557,7 @@
"outputs": [ "outputs": [
{ {
"name": "MODEL", "name": "MODEL",
"localized_name": "MODEL",
"type": "MODEL", "type": "MODEL",
"links": [ "links": [
123 123
...@@ -539,39 +575,6 @@ ...@@ -539,39 +575,6 @@
1 1
] ]
}, },
{
"id": 38,
"type": "SVDQuantFluxDiTLoader",
"pos": [
426.25274658203125,
905.1461181640625
],
"size": [
315,
82
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
122
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader"
},
"widgets_values": [
"mit-han-lab/svdq-int4-flux.1-dev",
0
]
},
{ {
"id": 10, "id": 10,
"type": "VAELoader", "type": "VAELoader",
...@@ -590,12 +593,13 @@ ...@@ -590,12 +593,13 @@
"outputs": [ "outputs": [
{ {
"name": "VAE", "name": "VAE",
"localized_name": "VAE",
"type": "VAE", "type": "VAE",
"shape": 3,
"links": [ "links": [
12 12
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -617,12 +621,13 @@ ...@@ -617,12 +621,13 @@
178 178
], ],
"flags": {}, "flags": {},
"order": 3, "order": 5,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "CLIP", "name": "CLIP",
"localized_name": "CLIP",
"type": "CLIP", "type": "CLIP",
"links": [ "links": [
118 118
...@@ -658,30 +663,35 @@ ...@@ -658,30 +663,35 @@
"inputs": [ "inputs": [
{ {
"name": "noise", "name": "noise",
"localized_name": "noise",
"type": "NOISE", "type": "NOISE",
"link": 37, "link": 37,
"slot_index": 0 "slot_index": 0
}, },
{ {
"name": "guider", "name": "guider",
"localized_name": "guider",
"type": "GUIDER", "type": "GUIDER",
"link": 30, "link": 30,
"slot_index": 1 "slot_index": 1
}, },
{ {
"name": "sampler", "name": "sampler",
"localized_name": "sampler",
"type": "SAMPLER", "type": "SAMPLER",
"link": 19, "link": 19,
"slot_index": 2 "slot_index": 2
}, },
{ {
"name": "sigmas", "name": "sigmas",
"localized_name": "sigmas",
"type": "SIGMAS", "type": "SIGMAS",
"link": 20, "link": 20,
"slot_index": 3 "slot_index": 3
}, },
{ {
"name": "latent_image", "name": "latent_image",
"localized_name": "latent_image",
"type": "LATENT", "type": "LATENT",
"link": 116, "link": 116,
"slot_index": 4 "slot_index": 4
...@@ -690,24 +700,61 @@ ...@@ -690,24 +700,61 @@
"outputs": [ "outputs": [
{ {
"name": "output", "name": "output",
"localized_name": "output",
"type": "LATENT", "type": "LATENT",
"shape": 3,
"links": [ "links": [
24 24
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
}, },
{ {
"name": "denoised_output", "name": "denoised_output",
"localized_name": "denoised_output",
"type": "LATENT", "type": "LATENT",
"links": null, "shape": 3,
"shape": 3 "links": null
} }
], ],
"properties": { "properties": {
"Node name for S&R": "SamplerCustomAdvanced" "Node name for S&R": "SamplerCustomAdvanced"
}, },
"widgets_values": [] "widgets_values": []
},
{
"id": 38,
"type": "SVDQuantFluxDiTLoader",
"pos": [
425.7825012207031,
887.9263916015625
],
"size": [
315,
106
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"localized_name": "MODEL",
"type": "MODEL",
"links": [
122
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader"
},
"widgets_values": [
"mit-han-lab/svdq-int4-flux.1-dev",
"disable",
0
]
} }
], ],
"links": [ "links": [
...@@ -870,8 +917,8 @@ ...@@ -870,8 +917,8 @@
"ds": { "ds": {
"scale": 1.0152559799477106, "scale": 1.0152559799477106,
"offset": [ "offset": [
521.7873982958799, 1093.678904911345,
167.19904950835112 404.94781362261836
] ]
}, },
"groupNodes": { "groupNodes": {
...@@ -1066,7 +1113,7 @@ ...@@ -1066,7 +1113,7 @@
} }
}, },
"node_versions": { "node_versions": {
"comfy-core": "0.3.14" "comfy-core": "0.3.24"
} }
}, },
"version": 0.4 "version": 0.4
......
...@@ -19,11 +19,13 @@ ...@@ -19,11 +19,13 @@
"inputs": [ "inputs": [
{ {
"name": "samples", "name": "samples",
"localized_name": "samples",
"type": "LATENT", "type": "LATENT",
"link": 7 "link": 7
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"type": "VAE", "type": "VAE",
"link": 60 "link": 60
} }
...@@ -31,6 +33,7 @@ ...@@ -31,6 +33,7 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
95 95
...@@ -60,26 +63,31 @@ ...@@ -60,26 +63,31 @@
"inputs": [ "inputs": [
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 80 "link": 80
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 81 "link": 81
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"type": "VAE", "type": "VAE",
"link": 82 "link": 82
}, },
{ {
"name": "pixels", "name": "pixels",
"localized_name": "pixels",
"type": "IMAGE", "type": "IMAGE",
"link": 107 "link": 107
}, },
{ {
"name": "mask", "name": "mask",
"localized_name": "mask",
"type": "MASK", "type": "MASK",
"link": 108 "link": 108
} }
...@@ -87,6 +95,7 @@ ...@@ -87,6 +95,7 @@
"outputs": [ "outputs": [
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
77 77
...@@ -95,6 +104,7 @@ ...@@ -95,6 +104,7 @@
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
78 78
...@@ -103,6 +113,7 @@ ...@@ -103,6 +113,7 @@
}, },
{ {
"name": "latent", "name": "latent",
"localized_name": "latent",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
88 88
...@@ -134,21 +145,25 @@ ...@@ -134,21 +145,25 @@
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 102 "link": 102
}, },
{ {
"name": "positive", "name": "positive",
"localized_name": "positive",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 77 "link": 77
}, },
{ {
"name": "negative", "name": "negative",
"localized_name": "negative",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 78 "link": 78
}, },
{ {
"name": "latent_image", "name": "latent_image",
"localized_name": "latent_image",
"type": "LATENT", "type": "LATENT",
"link": 88 "link": 88
} }
...@@ -156,6 +171,7 @@ ...@@ -156,6 +171,7 @@
"outputs": [ "outputs": [
{ {
"name": "LATENT", "name": "LATENT",
"localized_name": "LATENT",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
7 7
...@@ -167,7 +183,7 @@ ...@@ -167,7 +183,7 @@
"Node name for S&R": "KSampler" "Node name for S&R": "KSampler"
}, },
"widgets_values": [ "widgets_values": [
54184445162233, 482487939694684,
"randomize", "randomize",
20, 20,
1, 1,
...@@ -176,35 +192,6 @@ ...@@ -176,35 +192,6 @@
1 1
] ]
}, },
{
"id": 9,
"type": "SaveImage",
"pos": [
1879,
90
],
"size": [
828.9535522460938,
893.8475341796875
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 95
}
],
"outputs": [],
"properties": {
"Node name for S&R": "SaveImage"
},
"widgets_values": [
"ComfyUI"
]
},
{ {
"id": 26, "id": 26,
"type": "FluxGuidance", "type": "FluxGuidance",
...@@ -222,6 +209,7 @@ ...@@ -222,6 +209,7 @@
"inputs": [ "inputs": [
{ {
"name": "conditioning", "name": "conditioning",
"localized_name": "conditioning",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 41 "link": 41
} }
...@@ -229,12 +217,13 @@ ...@@ -229,12 +217,13 @@
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"shape": 3,
"links": [ "links": [
80 80
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -263,6 +252,7 @@ ...@@ -263,6 +252,7 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"type": "CLIP", "type": "CLIP",
"link": 63 "link": 63
} }
...@@ -270,6 +260,7 @@ ...@@ -270,6 +260,7 @@
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
81 81
...@@ -296,7 +287,7 @@ ...@@ -296,7 +287,7 @@
], ],
"size": [ "size": [
315, 315,
106 122
], ],
"flags": {}, "flags": {},
"order": 0, "order": 0,
...@@ -305,6 +296,7 @@ ...@@ -305,6 +296,7 @@
"outputs": [ "outputs": [
{ {
"name": "CLIP", "name": "CLIP",
"localized_name": "CLIP",
"type": "CLIP", "type": "CLIP",
"links": [ "links": [
62, 62,
...@@ -322,72 +314,6 @@ ...@@ -322,72 +314,6 @@
"default" "default"
] ]
}, },
{
"id": 32,
"type": "VAELoader",
"pos": [
1303,
424
],
"size": [
315,
58
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
60,
82
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"ae.safetensors"
]
},
{
"id": 45,
"type": "SVDQuantFluxDiTLoader",
"pos": [
936.3029174804688,
-113.06819915771484
],
"size": [
315,
82
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
102
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader"
},
"widgets_values": [
"mit-han-lab/svdq-int4-flux.1-fill-dev",
0
]
},
{ {
"id": 58, "id": 58,
"type": "ImageAndMaskResizeNode", "type": "ImageAndMaskResizeNode",
...@@ -405,11 +331,13 @@ ...@@ -405,11 +331,13 @@
"inputs": [ "inputs": [
{ {
"name": "image", "name": "image",
"localized_name": "image",
"type": "IMAGE", "type": "IMAGE",
"link": 105 "link": 105
}, },
{ {
"name": "mask", "name": "mask",
"localized_name": "mask",
"type": "MASK", "type": "MASK",
"link": 106 "link": 106
} }
...@@ -417,6 +345,7 @@ ...@@ -417,6 +345,7 @@
"outputs": [ "outputs": [
{ {
"name": "image", "name": "image",
"localized_name": "image",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
107 107
...@@ -425,6 +354,7 @@ ...@@ -425,6 +354,7 @@
}, },
{ {
"name": "mask", "name": "mask",
"localized_name": "mask",
"type": "MASK", "type": "MASK",
"links": [ "links": [
108 108
...@@ -460,6 +390,7 @@ ...@@ -460,6 +390,7 @@
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"type": "CLIP", "type": "CLIP",
"link": 62 "link": 62
} }
...@@ -467,6 +398,7 @@ ...@@ -467,6 +398,7 @@
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
41 41
...@@ -496,7 +428,7 @@ ...@@ -496,7 +428,7 @@
132.3040771484375 132.3040771484375
], ],
"flags": {}, "flags": {},
"order": 3, "order": 2,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [], "outputs": [],
...@@ -509,6 +441,41 @@ ...@@ -509,6 +441,41 @@
"color": "#432", "color": "#432",
"bgcolor": "#653" "bgcolor": "#653"
}, },
{
"id": 45,
"type": "SVDQuantFluxDiTLoader",
"pos": [
936.3029174804688,
-113.06819915771484
],
"size": [
315,
106
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"localized_name": "MODEL",
"type": "MODEL",
"links": [
102
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader"
},
"widgets_values": [
"mit-han-lab/svdq-int4-flux.1-fill-dev",
"disable",
0
]
},
{ {
"id": 17, "id": 17,
"type": "LoadImage", "type": "LoadImage",
...@@ -529,30 +496,96 @@ ...@@ -529,30 +496,96 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"shape": 3,
"links": [ "links": [
105 105
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
}, },
{ {
"name": "MASK", "name": "MASK",
"localized_name": "MASK",
"type": "MASK", "type": "MASK",
"shape": 3,
"links": [ "links": [
106 106
], ],
"slot_index": 1, "slot_index": 1
"shape": 3
} }
], ],
"properties": { "properties": {
"Node name for S&R": "LoadImage" "Node name for S&R": "LoadImage"
}, },
"widgets_values": [ "widgets_values": [
"clipspace/clipspace-mask-8389612.599999994.png [input]", "clipspace/clipspace-mask-331829.799999997.png [input]",
"image" "image"
] ]
},
{
"id": 32,
"type": "VAELoader",
"pos": [
953.8762817382812,
440.3467102050781
],
"size": [
315,
58
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"localized_name": "VAE",
"type": "VAE",
"links": [
60,
82
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"ae.safetensors"
]
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1862.43359375,
96.36107635498047
],
"size": [
828.9535522460938,
893.8475341796875
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "images",
"localized_name": "images",
"type": "IMAGE",
"link": 95
}
],
"outputs": [],
"properties": {
"Node name for S&R": "SaveImage"
},
"widgets_values": [
"ComfyUI"
]
} }
], ],
"links": [ "links": [
...@@ -697,14 +730,14 @@ ...@@ -697,14 +730,14 @@
"config": {}, "config": {},
"extra": { "extra": {
"ds": { "ds": {
"scale": 0.8390545288824038, "scale": 1.7985878990921451,
"offset": [ "offset": [
815.2093059315082, -287.8887097712823,
185.9955477896796 208.1745856210748
] ]
}, },
"node_versions": { "node_versions": {
"comfy-core": "0.3.14", "comfy-core": "0.3.24",
"comfyui-inpainteasy": "1.0.2" "comfyui-inpainteasy": "1.0.2"
} }
}, },
......
...@@ -14,16 +14,18 @@ ...@@ -14,16 +14,18 @@
46 46
], ],
"flags": {}, "flags": {},
"order": 12, "order": 10,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
"name": "samples", "name": "samples",
"localized_name": "samples",
"type": "LATENT", "type": "LATENT",
"link": 24 "link": 24
}, },
{ {
"name": "vae", "name": "vae",
"localized_name": "vae",
"type": "VAE", "type": "VAE",
"link": 12 "link": 12
} }
...@@ -31,6 +33,7 @@ ...@@ -31,6 +33,7 @@
"outputs": [ "outputs": [
{ {
"name": "IMAGE", "name": "IMAGE",
"localized_name": "IMAGE",
"type": "IMAGE", "type": "IMAGE",
"links": [ "links": [
9 9
...@@ -55,12 +58,13 @@ ...@@ -55,12 +58,13 @@
106 106
], ],
"flags": {}, "flags": {},
"order": 2, "order": 0,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "LATENT", "name": "LATENT",
"localized_name": "LATENT",
"type": "LATENT", "type": "LATENT",
"links": [ "links": [
23 23
...@@ -91,17 +95,18 @@ ...@@ -91,17 +95,18 @@
58 58
], ],
"flags": {}, "flags": {},
"order": 3, "order": 1,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "SAMPLER", "name": "SAMPLER",
"localized_name": "SAMPLER",
"type": "SAMPLER", "type": "SAMPLER",
"shape": 3,
"links": [ "links": [
19 19
], ]
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -123,11 +128,12 @@ ...@@ -123,11 +128,12 @@
106 106
], ],
"flags": {}, "flags": {},
"order": 8, "order": 7,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 41, "link": 41,
"slot_index": 0 "slot_index": 0
...@@ -136,11 +142,12 @@ ...@@ -136,11 +142,12 @@
"outputs": [ "outputs": [
{ {
"name": "SIGMAS", "name": "SIGMAS",
"localized_name": "SIGMAS",
"type": "SIGMAS", "type": "SIGMAS",
"shape": 3,
"links": [ "links": [
20 20
], ]
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -152,31 +159,6 @@ ...@@ -152,31 +159,6 @@
1 1
] ]
}, },
{
"id": 27,
"type": "Note",
"pos": [
480,
960
],
"size": [
311.3529052734375,
131.16229248046875
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"text": ""
},
"widgets_values": [
"The schnell model is a distilled model that can generate a good image with only 4 steps."
],
"color": "#432",
"bgcolor": "#653"
},
{ {
"id": 22, "id": 22,
"type": "BasicGuider", "type": "BasicGuider",
...@@ -189,17 +171,19 @@ ...@@ -189,17 +171,19 @@
46 46
], ],
"flags": {}, "flags": {},
"order": 10, "order": 8,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
"name": "model", "name": "model",
"localized_name": "model",
"type": "MODEL", "type": "MODEL",
"link": 42, "link": 42,
"slot_index": 0 "slot_index": 0
}, },
{ {
"name": "conditioning", "name": "conditioning",
"localized_name": "conditioning",
"type": "CONDITIONING", "type": "CONDITIONING",
"link": 40, "link": 40,
"slot_index": 1 "slot_index": 1
...@@ -208,12 +192,13 @@ ...@@ -208,12 +192,13 @@
"outputs": [ "outputs": [
{ {
"name": "GUIDER", "name": "GUIDER",
"localized_name": "GUIDER",
"type": "GUIDER", "type": "GUIDER",
"shape": 3,
"links": [ "links": [
30 30
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -233,11 +218,12 @@ ...@@ -233,11 +218,12 @@
164.31304931640625 164.31304931640625
], ],
"flags": {}, "flags": {},
"order": 9, "order": 6,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
"name": "clip", "name": "clip",
"localized_name": "clip",
"type": "CLIP", "type": "CLIP",
"link": 43 "link": 43
} }
...@@ -245,6 +231,7 @@ ...@@ -245,6 +231,7 @@
"outputs": [ "outputs": [
{ {
"name": "CONDITIONING", "name": "CONDITIONING",
"localized_name": "CONDITIONING",
"type": "CONDITIONING", "type": "CONDITIONING",
"links": [ "links": [
40 40
...@@ -273,35 +260,40 @@ ...@@ -273,35 +260,40 @@
106 106
], ],
"flags": {}, "flags": {},
"order": 11, "order": 9,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
"name": "noise", "name": "noise",
"localized_name": "noise",
"type": "NOISE", "type": "NOISE",
"link": 37, "link": 37,
"slot_index": 0 "slot_index": 0
}, },
{ {
"name": "guider", "name": "guider",
"localized_name": "guider",
"type": "GUIDER", "type": "GUIDER",
"link": 30, "link": 30,
"slot_index": 1 "slot_index": 1
}, },
{ {
"name": "sampler", "name": "sampler",
"localized_name": "sampler",
"type": "SAMPLER", "type": "SAMPLER",
"link": 19, "link": 19,
"slot_index": 2 "slot_index": 2
}, },
{ {
"name": "sigmas", "name": "sigmas",
"localized_name": "sigmas",
"type": "SIGMAS", "type": "SIGMAS",
"link": 20, "link": 20,
"slot_index": 3 "slot_index": 3
}, },
{ {
"name": "latent_image", "name": "latent_image",
"localized_name": "latent_image",
"type": "LATENT", "type": "LATENT",
"link": 23, "link": 23,
"slot_index": 4 "slot_index": 4
...@@ -310,18 +302,20 @@ ...@@ -310,18 +302,20 @@
"outputs": [ "outputs": [
{ {
"name": "output", "name": "output",
"localized_name": "output",
"type": "LATENT", "type": "LATENT",
"shape": 3,
"links": [ "links": [
24 24
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
}, },
{ {
"name": "denoised_output", "name": "denoised_output",
"localized_name": "denoised_output",
"type": "LATENT", "type": "LATENT",
"links": null, "shape": 3,
"shape": 3 "links": null
} }
], ],
"properties": { "properties": {
...@@ -341,11 +335,12 @@ ...@@ -341,11 +335,12 @@
1060.3828125 1060.3828125
], ],
"flags": {}, "flags": {},
"order": 13, "order": 11,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
"name": "images", "name": "images",
"localized_name": "images",
"type": "IMAGE", "type": "IMAGE",
"link": 9 "link": 9
} }
...@@ -368,17 +363,18 @@ ...@@ -368,17 +363,18 @@
82 82
], ],
"flags": {}, "flags": {},
"order": 6, "order": 2,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "NOISE", "name": "NOISE",
"localized_name": "NOISE",
"type": "NOISE", "type": "NOISE",
"shape": 3,
"links": [ "links": [
37 37
], ]
"shape": 3
} }
], ],
"properties": { "properties": {
...@@ -400,10 +396,10 @@ ...@@ -400,10 +396,10 @@
], ],
"size": [ "size": [
352.79998779296875, 352.79998779296875,
130 178
], ],
"flags": {}, "flags": {},
"order": 7, "order": 3,
"mode": 0, "mode": 0,
"inputs": [ "inputs": [
{ {
...@@ -415,6 +411,7 @@ ...@@ -415,6 +411,7 @@
"outputs": [ "outputs": [
{ {
"name": "CLIP", "name": "CLIP",
"localized_name": "CLIP",
"type": "CLIP", "type": "CLIP",
"links": [ "links": [
43 43
...@@ -429,77 +426,57 @@ ...@@ -429,77 +426,57 @@
"flux", "flux",
"t5xxl_fp16.safetensors", "t5xxl_fp16.safetensors",
"clip_l.safetensors", "clip_l.safetensors",
512 512,
"BF16",
"mit-han-lab/svdq-flux.1-t5"
] ]
}, },
{ {
"id": 10, "id": 28,
"type": "VAELoader", "type": "SVDQuantFluxDiTLoader",
"pos": [ "pos": [
-31.617252349853516, -10.846628189086914,
377.54791259765625 890.9998779296875
], ],
"size": [ "size": [
315, 315,
58 106
], ],
"flags": {}, "flags": {},
"order": 0, "order": 4,
"mode": 0, "mode": 0,
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "VAE", "name": "MODEL",
"type": "VAE", "localized_name": "MODEL",
"type": "MODEL",
"links": [ "links": [
12 41,
42
], ],
"slot_index": 0, "slot_index": 0
"shape": 3
} }
], ],
"properties": { "properties": {
"Node name for S&R": "VAELoader" "Node name for S&R": "SVDQuantFluxDiTLoader"
}, },
"widgets_values": [ "widgets_values": [
"ae.safetensors" "mit-han-lab/svdq-int4-flux.1-schnell",
"disable",
0
] ]
}, },
{ {
"id": 26, "id": 10,
"type": "Note", "type": "VAELoader",
"pos": [
-28.286691665649414,
511.4660339355469
],
"size": [
336,
288
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"text": ""
},
"widgets_values": [
"If you get an error in any of the nodes above make sure the files are in the correct directories.\n\nSee the top of the examples page for the links : https://comfyanonymous.github.io/ComfyUI_examples/flux/\n\nflux1-schnell.safetensors goes in: ComfyUI/models/unet/\n\nt5xxl_fp16.safetensors and clip_l.safetensors go in: ComfyUI/models/clip/\n\nae.safetensors goes in: ComfyUI/models/vae/\n\n\nTip: You can set the weight_dtype above to one of the fp8 types if you have memory issues."
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 28,
"type": "SVDQuantFluxDiTLoader",
"pos": [ "pos": [
-10.846628189086914, 874.65625,
890.9998779296875 480.88372802734375
], ],
"size": [ "size": [
315, 315,
82 58
], ],
"flags": {}, "flags": {},
"order": 5, "order": 5,
...@@ -507,21 +484,21 @@ ...@@ -507,21 +484,21 @@
"inputs": [], "inputs": [],
"outputs": [ "outputs": [
{ {
"name": "MODEL", "name": "VAE",
"type": "MODEL", "localized_name": "VAE",
"type": "VAE",
"shape": 3,
"links": [ "links": [
41, 12
42
], ],
"slot_index": 0 "slot_index": 0
} }
], ],
"properties": { "properties": {
"Node name for S&R": "SVDQuantFluxDiTLoader" "Node name for S&R": "VAELoader"
}, },
"widgets_values": [ "widgets_values": [
"mit-han-lab/svdq-int4-flux.1-schnell", "ae.safetensors"
0
] ]
} }
], ],
...@@ -627,11 +604,14 @@ ...@@ -627,11 +604,14 @@
"config": {}, "config": {},
"extra": { "extra": {
"ds": { "ds": {
"scale": 0.6727499949325652, "scale": 1.1167815779424761,
"offset": [ "offset": [
405.6825017392191, 874.5548427683093,
29.738440474209906 429.12540214017235
] ]
},
"node_versions": {
"comfy-core": "0.3.24"
} }
}, },
"version": 0.4 "version": 0.4
......
import torch import torch
from diffusers import FluxPipeline from diffusers import FluxPipeline
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku import NunchakuFluxTransformer2dModel
transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-fp4-flux.1-dev", precision="fp4") transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-fp4-flux.1-dev", precision="fp4")
pipeline = FluxPipeline.from_pretrained( pipeline = FluxPipeline.from_pretrained(
......
import torch import torch
from diffusers import FluxPipeline from diffusers import FluxPipeline
from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel from nunchaku import NunchakuFluxTransformer2dModel
transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-fp4-flux.1-schnell", precision="fp4") transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-fp4-flux.1-schnell", precision="fp4")
pipeline = FluxPipeline.from_pretrained( pipeline = FluxPipeline.from_pretrained(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment