diff --git a/onediff_comfy_nodes/README.md b/onediff_comfy_nodes/README.md index 4775e91c0..1b8510673 100644 --- a/onediff_comfy_nodes/README.md +++ b/onediff_comfy_nodes/README.md @@ -5,27 +5,24 @@ - [Installation Guide](#installation-guide) - [Basical Nodes Usage](#basical-nodes-usage) - [Model Acceleration](#model-acceleration) - - [Model Speedup](#model-speedup) - - [Model Graph Saver](#model-graph-saver) - - [Model Graph Loader](#model-graph-loader) + - [Load Checkpoint - OneDiff](#load-checkpoint---onediff) - [Quantization](#quantization) - [Image Distinction Scanner](#image-distinction-scanner) - - [Examples](#onediff-community-examples) + - [OneDiff Community Examples](#onediff-community-examples) - [LoRA](#lora) - [ControlNet](#controlnet) - [SVD](#svd) - [DeepCache](#deepcache) - ## Performance of Community Edition Updated on DEC 7, 2023. Device: RTX 3090 -| SDXL1.0-base (1024x1024) | torch(Baseline) | onediff(Optimized) | Percentage improvement | -|--------------------------------------------------|-----------------|--------------------|------------------------| -| [Stable Diffusion workflow(UNet)](workflows/model-speedup.png) | 4.08it/s | 6.13it/s | 50.25% | -| [LoRA workflow](workflows/model-speedup-lora.png) | 4.05it/s | 6.14it/s | 51.60% | +| SDXL1.0-base (1024x1024) | torch(Baseline) | onediff(Optimized) | Percentage improvement | +| -------------------------------------------------------------- | --------------- | ------------------ | ---------------------- | +| [Stable Diffusion workflow(UNet)](workflows/model-speedup.png) | 4.08it/s | 6.70it/s | 64.2 % | +| [LoRA workflow](workflows/model-speedup-lora.png) | 4.05it/s | 6.69it/s | 65.1 % | ## Installation Guide @@ -80,29 +77,17 @@ If you need Enterprise Level Support for your system or business, please refer t ### Model Acceleration -#### Model Speedup - -The "Model Speedup" node takes a model as input and outputs an optimized model. +#### Load Checkpoint - OneDiff -If the `static_mode` is `enabled` (which is the default), it will take some time to compile before the first inference. +The "Load Checkpoint - OneDiff" node is optimized for OneDiff. -If `static_model` is `disabled`, there is no need for additional compilation time before the first inference, but the inference speed will be slower compared to `enabled`, albeit slightly. +It can be used to load checkpoints and accelerate the model. ![](workflows/model-speedup.png) -#### Model Graph Saver - -The optimized model from the "Model Speedup" node can be saved to "graph" by the "Model Graph Saver" node, allowing it to be used in other scenarios without the need for recompilation. - -![](workflows/model-graph-saver.png) - -You can set different file name prefixes for different types of models. -#### Model Graph Loader +The "Load Checkpoint - OneDiff" node set `vae_speedup` : `enable` to enable VAE acceleration. -The "Model Graph Loader" node is used to load graph files from the disk, thus saving the time required for the initial compilation. - -![](workflows/model-graph-loader.png) ### Quantization @@ -114,27 +99,6 @@ The "UNet Loader Int8" node is used to load quantized models. Quantized models n The compilation result of the quantized model can also be saved as a graph and loaded when needed. - -![quantized model saver](workflows/int8-graph-saver.png) - -![quantized model loader](workflows/int8-graph-loader.png) - - -### VAE Acceleration - -The VAE nodes used for accelerating, saving, and loading VAE graphs operate in a manner very similar to the usage of Model nodes. - -Omitting specific details here, the following workflow can be loaded and tested. - -**VAE Speedup and Graph Saver** - -![](workflows/vae-graph-saver.png) - -**VAE Speedup and Graph Loader** - -![](workflows/vae-graph-loader.png) - - ### Image Distinction Scanner The "Image Distinction Scanner" node is used to compare the differences between two images and visualize the resulting variances. diff --git a/onediff_comfy_nodes/_nodes.py b/onediff_comfy_nodes/_nodes.py index fc5ffbfa2..86ea7ea91 100644 --- a/onediff_comfy_nodes/_nodes.py +++ b/onediff_comfy_nodes/_nodes.py @@ -632,4 +632,4 @@ def load_checkpoint( "graph_file_device": model_management.get_torch_device(), }, ) - return oneflow_model, clip, vae + return oneflow_model, clip, vae \ No newline at end of file diff --git a/onediff_comfy_nodes/workflows/model-speedup.png b/onediff_comfy_nodes/workflows/model-speedup.png index 2e7e6646a..a46507f83 100644 Binary files a/onediff_comfy_nodes/workflows/model-speedup.png and b/onediff_comfy_nodes/workflows/model-speedup.png differ