Skip to content

Commit

Permalink
add workflow png and json (#1127)
Browse files Browse the repository at this point in the history
add workflow png and json for sdxl and sd1.5

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Enhanced clarity and accuracy of the ComfyUI online quantization
guide.
	- Updated section headers with hyperlinks for improved navigation.
	- Reformatted performance comparison tables for better readability.
	- Corrected links to workflow JSON files and updated image references.
- Clarified installation instructions, specifying correct file paths and
formats.
- **New Features**
- Introduced new JSON configuration files defining workflows for image
processing and model quantization, including nodes for sampling,
encoding, decoding, and saving images.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
XuZhang99 authored Jan 10, 2025
1 parent c8f513e commit 1be9b27
Show file tree
Hide file tree
Showing 13 changed files with 708 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions onediff_comfy_nodes/docs/ComfyUI_Online_Quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Note that you can download all images in this page and then drag or load them on

#### Examples

| Baseline (non-optimized) | OneDiff(optimized) | OneDiff Quant(optimized) |
| [Baseline (non-optimized)](../workflows/sdxl-baseline.json) | [OneDiff(optimized)](../workflows/sdxl-onediff.json) | [OneDiff Quant(optimized)](../workflows/sdxl-quant.json) |
| ------------------------ | ------------------ | ------------------------ |
|![image](https://github.com/fmk345/pythonProject/assets/74238139/d5499822-e0b0-4186-831c-18f4c8921ec4)|![image](https://github.com/fmk345/pythonProject/assets/74238139/14feaaf4-6672-430c-85ff-d8c7d8b4d5a2)|![image](https://github.com/fmk345/pythonProject/assets/74238139/cb99f5d7-fb4f-421c-9783-a3adc4375759)|
|![image](../comfyui_workflow_images/sdxl-baseline.png)|![image](../comfyui_workflow_images/sdxl-onediff.png)|![image](../comfyui_workflow_images/sdxl-quant.png)|

Model parameters can be referred to [Parameter Description](#parameter-description).

Expand All @@ -74,7 +74,7 @@ python main.py --gpu-only



### SD1.5
### [SD1.5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5)

We compared the performance of the stable-diffusion-v1-5 model in the three conditions and listed them in the subscript.

Expand All @@ -88,9 +88,9 @@ Note that you can download all images in this page and then drag or load them on

#### Examples

| Baseline (non-optimized) | OneDiff(optimized) | OneDiff Quant(optimized) |
| [Baseline (non-optimized)](../workflows/sd15-baseline.json) | [OneDiff(optimized)](../workflows/sd15-onediff.json) | [OneDiff Quant(optimized)](../workflows/sd15-quant.json) |
| ------------------------ | ------------------ | ------------------------ |
|![image](https://github.com/fmk345/pythonProject/assets/74238139/948271d2-24db-483f-9f33-81a64ae44c9e)|![image](https://github.com/fmk345/pythonProject/assets/74238139/08495a75-03f5-4e7d-93a2-b206ea755901)|![image](https://github.com/fmk345/pythonProject/assets/74238139/10c00186-fe72-4cca-92d2-2a672b8ffac5)|
|![image](../comfyui_workflow_images/sd15-baseline.png)|![image](../comfyui_workflow_images/sd15-onediff.png)|![image](../comfyui_workflow_images/sd15-quant.png)|

Model parameters can be referred to [Parameter Description](#parameter-description).

Expand All @@ -100,7 +100,7 @@ Model parameters can be referred to [Parameter Description](#parameter-descripti

```
cd ComfyUI
wget -O models/v1-5-pruned-emaonly.ckpt https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt
wget -O models/checkpoints/v1-5-pruned-emaonly.safetensors https://huggingface.co/sd-legacy/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
```


Expand Down
107 changes: 107 additions & 0 deletions onediff_comfy_nodes/workflows/sd15-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"3": {
"inputs": {
"seed": 1004586347945964,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"4",
0
],
"positive": [
"6",
0
],
"negative": [
"7",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"4": {
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 4
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "text, watermark",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}
108 changes: 108 additions & 0 deletions onediff_comfy_nodes/workflows/sd15-onediff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"3": {
"inputs": {
"seed": 879355500122229,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"10",
0
],
"positive": [
"6",
0
],
"negative": [
"7",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 4
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
"clip": [
"10",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "text, watermark",
"clip": [
"10",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"10",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
},
"10": {
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly.safetensors",
"vae_speedup": "disable"
},
"class_type": "OneDiffCheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint - OneDiff"
}
}
}
136 changes: 136 additions & 0 deletions onediff_comfy_nodes/workflows/sd15-quant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"3": {
"inputs": {
"seed": 439837692531257,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"10",
0
],
"positive": [
"6",
0
],
"negative": [
"7",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 4
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
"clip": [
"10",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "text, watermark",
"clip": [
"10",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"10",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
},
"10": {
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly.safetensors",
"vae_speedup": "disable",
"custom_booster": [
"12",
0
]
},
"class_type": "OneDiffCheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint - OneDiff"
}
},
"12": {
"inputs": {
"quantization_booster": [
"13",
0
]
},
"class_type": "OneDiffModelBooster",
"_meta": {
"title": "Apply Model Booster - OneDiff"
}
},
"13": {
"inputs": {
"quantized_conv_percentage": 100,
"quantized_linear_percentage": 100,
"conv_compute_density_threshold": 100,
"linear_compute_density_threshold": 300
},
"class_type": "OneDiffOnlineQuantizationBooster",
"_meta": {
"title": "Online OneFlow Quantizer - OneDiff"
}
}
}
Loading

0 comments on commit 1be9b27

Please sign in to comment.