Skip to content

add OptimalSteps examples #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions flux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ You can then load or drag the following image in ComfyUI to get the workflow:

![Example](flux_dev_checkpoint_example.png)


#### OptimalSteps for accelerating

You can use the "OptimalStepsScheduler" to get a satisfactory result with much less inference time. (Now only support for Flux Dev fp16). More details can be found in [OptimalSteps](https://github.com/bebebe666/OptimalSteps). Here is a demo for 10 steps result:

![Example](flux_dev_OptimalSteps.png)

[Workflow in Json format](flux_dev_OptimalSteps.json)


### Flux Schnell

For Flux schnell you can get the checkpoint [here](https://huggingface.co/Comfy-Org/flux1-schnell/blob/main/flux1-schnell-fp8.safetensors) that you can put in your: ComfyUI/models/checkpoints/ directory.
Expand Down
1 change: 1 addition & 0 deletions flux/flux_dev_OptimalSteps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"84cd4c92-6554-48d7-90e2-060f3bc8a5ae","revision":0,"last_node_id":40,"last_link_id":123,"nodes":[{"id":13,"type":"SamplerCustomAdvanced","pos":[1245.914794921875,185.88938903808594],"size":[272.3617858886719,124.53733825683594],"flags":{},"order":14,"mode":0,"inputs":[{"label":"noise","localized_name":"noise","name":"noise","type":"NOISE","link":37},{"label":"guider","localized_name":"guider","name":"guider","type":"GUIDER","link":30},{"label":"sampler","localized_name":"sampler","name":"sampler","type":"SAMPLER","link":19},{"label":"sigmas","localized_name":"sigmas","name":"sigmas","type":"SIGMAS","link":123},{"label":"latent_image","localized_name":"latent_image","name":"latent_image","type":"LATENT","link":117}],"outputs":[{"label":"output","localized_name":"output","name":"output","shape":3,"type":"LATENT","slot_index":0,"links":[24]},{"label":"denoised_output","localized_name":"denoised_output","name":"denoised_output","shape":3,"type":"LATENT","links":null}],"properties":{"Node name for S&R":"SamplerCustomAdvanced"},"widgets_values":[]},{"id":8,"type":"VAEDecode","pos":[1278.9639892578125,359.6733093261719],"size":[210,46],"flags":{},"order":15,"mode":0,"inputs":[{"label":"samples","localized_name":"samples","name":"samples","type":"LATENT","link":24},{"label":"vae","localized_name":"vae","name":"vae","type":"VAE","link":12}],"outputs":[{"label":"IMAGE","localized_name":"IMAGE","name":"IMAGE","type":"IMAGE","slot_index":0,"links":[9]}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":39,"type":"OptimalStepsScheduler","pos":[764.3771362304688,565.610107421875],"size":[315,106],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"localized_name":"SIGMAS","name":"SIGMAS","type":"SIGMAS","links":[123]}],"properties":{"Node name for S&R":"OptimalStepsScheduler"},"widgets_values":["FLUX",10,1]},{"id":9,"type":"SaveImage","pos":[1540.3621826171875,192.8608856201172],"size":[985.3012084960938,1060.3828125],"flags":{},"order":16,"mode":0,"inputs":[{"label":"images","localized_name":"images","name":"images","type":"IMAGE","link":9}],"outputs":[],"properties":{},"widgets_values":["OptimalSteps"]},{"id":27,"type":"EmptySD3LatentImage","pos":[806.1696166992188,390.7843322753906],"size":[315,106],"flags":{},"order":9,"mode":0,"inputs":[{"label":"width","name":"width","type":"INT","widget":{"name":"width"},"link":112},{"label":"height","name":"height","type":"INT","widget":{"name":"height"},"link":113}],"outputs":[{"label":"LATENT","localized_name":"LATENT","name":"LATENT","shape":3,"type":"LATENT","slot_index":0,"links":[117]}],"properties":{"Node name for S&R":"EmptySD3LatentImage"},"widgets_values":[1024,1024,1]},{"id":16,"type":"KSamplerSelect","pos":[827.154052734375,262.0060729980469],"size":[315,58],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"label":"SAMPLER","localized_name":"SAMPLER","name":"SAMPLER","shape":3,"type":"SAMPLER","links":[19]}],"properties":{"Node name for S&R":"KSamplerSelect"},"widgets_values":["euler"]},{"id":22,"type":"BasicGuider","pos":[895.2467651367188,130.99911499023438],"size":[222.3482666015625,46],"flags":{},"order":13,"mode":0,"inputs":[{"label":"model","localized_name":"model","name":"model","type":"MODEL","link":54},{"label":"conditioning","localized_name":"conditioning","name":"conditioning","type":"CONDITIONING","link":42}],"outputs":[{"label":"GUIDER","localized_name":"GUIDER","name":"GUIDER","shape":3,"type":"GUIDER","slot_index":0,"links":[30]}],"properties":{"Node name for S&R":"BasicGuider"},"widgets_values":[]},{"id":25,"type":"RandomNoise","pos":[840.4623413085938,-18.367921829223633],"size":[315,82],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"label":"NOISE","localized_name":"NOISE","name":"NOISE","shape":3,"type":"NOISE","links":[37]}],"properties":{"Node name for S&R":"RandomNoise"},"widgets_values":[0,"fixed"],"color":"#2a363b","bgcolor":"#3f5159"},{"id":26,"type":"FluxGuidance","pos":[530.4635620117188,102.99523162841797],"size":[317.4000244140625,58],"flags":{},"order":12,"mode":0,"inputs":[{"label":"conditioning","localized_name":"conditioning","name":"conditioning","type":"CONDITIONING","link":41}],"outputs":[{"label":"CONDITIONING","localized_name":"CONDITIONING","name":"CONDITIONING","shape":3,"type":"CONDITIONING","slot_index":0,"links":[42]}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5],"color":"#233","bgcolor":"#355"},{"id":30,"type":"ModelSamplingFlux","pos":[445.97320556640625,255.3803253173828],"size":[315,130],"flags":{},"order":11,"mode":0,"inputs":[{"label":"model","localized_name":"model","name":"model","type":"MODEL","link":56},{"label":"width","name":"width","type":"INT","widget":{"name":"width"},"link":115},{"label":"height","name":"height","type":"INT","widget":{"name":"height"},"link":114}],"outputs":[{"label":"MODEL","localized_name":"MODEL","name":"MODEL","shape":3,"type":"MODEL","slot_index":0,"links":[54]}],"properties":{"Node name for S&R":"ModelSamplingFlux"},"widgets_values":[1.15,0.5,1024,1024]},{"id":35,"type":"PrimitiveNode","pos":[430.0382995605469,470.0820007324219],"size":[210,82],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"label":"INT","name":"INT","type":"INT","widget":{"name":"height"},"slot_index":0,"links":[113,114]}],"title":"height","properties":{"Run widget replace on values":false},"widgets_values":[1024,"fixed"],"color":"#323","bgcolor":"#535"},{"id":34,"type":"PrimitiveNode","pos":[465.7486572265625,621.7686157226562],"size":[210,82],"flags":{},"order":4,"mode":0,"inputs":[],"outputs":[{"label":"INT","name":"INT","type":"INT","widget":{"name":"width"},"slot_index":0,"links":[112,115]}],"title":"width","properties":{"Run widget replace on values":false},"widgets_values":[1024,"fixed"],"color":"#323","bgcolor":"#535"},{"id":6,"type":"CLIPTextEncode","pos":[381.0870361328125,-135.64413452148438],"size":[422.84503173828125,164.31304931640625],"flags":{},"order":10,"mode":0,"inputs":[{"label":"clip","localized_name":"clip","name":"clip","type":"CLIP","link":10}],"outputs":[{"label":"CONDITIONING","localized_name":"CONDITIONING","name":"CONDITIONING","type":"CONDITIONING","slot_index":0,"links":[41]}],"title":"CLIP Text Encode (Positive Prompt)","properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["A fit athletic woman stands confidently, showcasing her strong physique. She has a heart-shaped face with high cheekbones, bright green eyes, and a warm, sun-kissed skin tone. Her curly brown hair is pulled back into a high ponytail, with a few loose strands framing her face. She wears a vibrant coral workout tank top that hugs her torso, accentuating her toned arms and shoulders, paired with high-waisted black leggings adorned with colorful geometric patterns. Her expression is focused and determined, with a slight smile suggesting enjoyment in her workout. She is mid-stretch, reaching her arms overhead with an open stance, exuding energy and enthusiasm. The background features a sunny outdoor park with green grass and trees, hinting at a lively and invigorating atmosphere."],"color":"#232","bgcolor":"#353"},{"id":11,"type":"DualCLIPLoader","pos":[8.783215522766113,88.33306884765625],"size":[315,122],"flags":{},"order":5,"mode":0,"inputs":[],"outputs":[{"label":"CLIP","localized_name":"CLIP","name":"CLIP","shape":3,"type":"CLIP","slot_index":0,"links":[10]}],"properties":{"Node name for S&R":"DualCLIPLoader"},"widgets_values":["t5xxl_fp16.safetensors","clip_l.safetensors","flux","default"]},{"id":10,"type":"VAELoader","pos":[-3.9881956577301025,416.0868835449219],"size":[311.81634521484375,60.429901123046875],"flags":{},"order":6,"mode":0,"inputs":[],"outputs":[{"label":"VAE","localized_name":"VAE","name":"VAE","shape":3,"type":"VAE","slot_index":0,"links":[12]}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["ae.safetensors"]},{"id":12,"type":"UNETLoader","pos":[-0.9881662726402283,276.1773986816406],"size":[315,82],"flags":{},"order":7,"mode":0,"inputs":[],"outputs":[{"label":"MODEL","localized_name":"MODEL","name":"MODEL","shape":3,"type":"MODEL","slot_index":0,"links":[56]}],"properties":{"Node name for S&R":"UNETLoader"},"widgets_values":["flux1-dev.safetensors","default"],"color":"#223","bgcolor":"#335"},{"id":28,"type":"Note","pos":[-27.13224220275879,537.5310668945312],"size":[336,288],"flags":{},"order":8,"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-dev.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"],"color":"#432","bgcolor":"#653"}],"links":[[9,8,0,9,0,"IMAGE"],[10,11,0,6,0,"CLIP"],[12,10,0,8,1,"VAE"],[19,16,0,13,2,"SAMPLER"],[24,13,0,8,0,"LATENT"],[30,22,0,13,1,"GUIDER"],[37,25,0,13,0,"NOISE"],[41,6,0,26,0,"CONDITIONING"],[42,26,0,22,1,"CONDITIONING"],[54,30,0,22,0,"MODEL"],[56,12,0,30,0,"MODEL"],[112,34,0,27,0,"INT"],[113,35,0,27,1,"INT"],[114,35,0,30,2,"INT"],[115,34,0,30,1,"INT"],[117,27,0,13,4,"LATENT"],[123,39,0,13,3,"SIGMAS"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.6115909044841611,"offset":[688.8255984069291,289.37942481269465]},"groupNodes":{}},"version":0.4}
Binary file added flux/flux_dev_OptimalSteps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions wan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ This workflow requires the [wan2.1_t2v_1.3B_fp16.safetensors](https://huggingfac

[Workflow in Json format](text_to_video_wan.json)

#### OptimalSteps for accelerating

You can use the "OptimalStepsScheduler" to get a satisfactory result with much less inference time. (Now only support for Wan14B). More details can be found in [OptimalSteps](https://github.com/bebebe666/OptimalSteps). Here is a demo for 20 steps result:

![Example](text_to_video_wan_OptimalSteps.webp)

[Workflow in Json format](text_to_video_wan_OptimalSteps.json)


### Image to Video

This workflow requires the [wan2.1_i2v_480p_14B_fp16.safetensors](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/blob/main/split_files/diffusion_models/wan2.1_i2v_480p_14B_fp16.safetensors) file (put it in: ComfyUI/models/diffusion_models/) and
Expand Down
1 change: 1 addition & 0 deletions wan/text_to_video_wan_OptimalSteps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"e50a64f4-8ecd-47b8-b608-0131e106b6ca","revision":0,"last_node_id":52,"last_link_id":109,"nodes":[{"id":47,"type":"SaveWEBM","pos":[2367.213134765625,193.6114959716797],"size":[315,130],"flags":{},"order":12,"mode":4,"inputs":[{"localized_name":"images","name":"images","type":"IMAGE","link":93}],"outputs":[],"properties":{"Node name for S&R":"SaveWEBM","cnr_id":"comfy-core","ver":"0.3.26"},"widgets_values":["ComfyUI","vp9",24,32]},{"id":8,"type":"VAEDecode","pos":[1217.8653564453125,52.345096588134766],"size":[210,46],"flags":{},"order":10,"mode":0,"inputs":[{"localized_name":"samples","name":"samples","type":"LATENT","link":100},{"localized_name":"vae","name":"vae","type":"VAE","link":76}],"outputs":[{"localized_name":"IMAGE","name":"IMAGE","type":"IMAGE","slot_index":0,"links":[56,93]}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":49,"type":"SamplerCustom","pos":[1076.5750732421875,175.3009796142578],"size":[355.20001220703125,230],"flags":{},"order":9,"mode":0,"inputs":[{"localized_name":"model","name":"model","type":"MODEL","link":96},{"localized_name":"positive","name":"positive","type":"CONDITIONING","link":97},{"localized_name":"negative","name":"negative","type":"CONDITIONING","link":98},{"localized_name":"sampler","name":"sampler","type":"SAMPLER","link":101},{"localized_name":"sigmas","name":"sigmas","type":"SIGMAS","link":109},{"localized_name":"latent_image","name":"latent_image","type":"LATENT","link":99}],"outputs":[{"localized_name":"output","name":"output","type":"LATENT","links":[100]},{"localized_name":"denoised_output","name":"denoised_output","type":"LATENT","links":null}],"properties":{"Node name for S&R":"SamplerCustom"},"widgets_values":[true,10,"fixed",6]},{"id":7,"type":"CLIPTextEncode","pos":[579.0982666015625,189.34701538085938],"size":[425.27801513671875,180.6060791015625],"flags":{},"order":7,"mode":0,"inputs":[{"localized_name":"clip","name":"clip","type":"CLIP","link":75}],"outputs":[{"localized_name":"CONDITIONING","name":"CONDITIONING","type":"CONDITIONING","slot_index":0,"links":[52,98]}],"title":"CLIP Text Encode (Negative Prompt)","properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"],"color":"#322","bgcolor":"#533"},{"id":6,"type":"CLIPTextEncode","pos":[123.975830078125,198.05618286132812],"size":[422.84503173828125,164.31304931640625],"flags":{},"order":6,"mode":0,"inputs":[{"localized_name":"clip","name":"clip","type":"CLIP","link":74}],"outputs":[{"localized_name":"CONDITIONING","name":"CONDITIONING","type":"CONDITIONING","slot_index":0,"links":[46,97]}],"title":"CLIP Text Encode (Positive Prompt)","properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["一名男子在跳台上做专业跳水动作。全景平拍镜头中,他穿着红色泳裤,身体呈倒立状态,双臂伸展,双腿并拢。镜头下移,他跳入水中,溅起水花。背景中是蓝色的泳池。"],"color":"#232","bgcolor":"#353"},{"id":50,"type":"KSamplerSelect","pos":[1078.2867431640625,482.516357421875],"size":[315,58],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"localized_name":"SAMPLER","name":"SAMPLER","type":"SAMPLER","links":[101]}],"properties":{"Node name for S&R":"KSamplerSelect"},"widgets_values":["euler"]},{"id":40,"type":"EmptyHunyuanLatentVideo","pos":[281.0233459472656,463.7597961425781],"size":[315,130],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"localized_name":"LATENT","name":"LATENT","type":"LATENT","slot_index":0,"links":[91,99]}],"properties":{"Node name for S&R":"EmptyHunyuanLatentVideo"},"widgets_values":[832,480,81,1]},{"id":38,"type":"CLIPLoader","pos":[-308.4200439453125,135.81011962890625],"size":[390,98],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"localized_name":"CLIP","name":"CLIP","type":"CLIP","slot_index":0,"links":[74,75]}],"properties":{"Node name for S&R":"CLIPLoader","models":[{"name":"umt5_xxl_fp16.safetensors","url":"https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp16.safetensors?download=true","directory":"text_encoders"}]},"widgets_values":["umt5_xxl_fp16.safetensors","wan","default"]},{"id":39,"type":"VAELoader","pos":[-247.95626831054688,292.0481872558594],"size":[306.36004638671875,58],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"localized_name":"VAE","name":"VAE","type":"VAE","slot_index":0,"links":[76]}],"properties":{"Node name for S&R":"VAELoader","models":[{"name":"wan_2.1_vae.safetensors","url":"https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors?download=true","directory":"vae"}]},"widgets_values":["wan_2.1_vae.safetensors"]},{"id":37,"type":"UNETLoader","pos":[-271.0419921875,-9.817980766296387],"size":[346.7470703125,82],"flags":{},"order":4,"mode":0,"inputs":[],"outputs":[{"localized_name":"MODEL","name":"MODEL","type":"MODEL","slot_index":0,"links":[94]}],"properties":{"Node name for S&R":"UNETLoader","models":[{"name":"wan2.1_t2v_14B_fp16.safetensors","url":"https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/diffusion_models/wan2.1_t2v_14B_fp16.safetensors?download=true","directory":"diffusion_models"}]},"widgets_values":["wan2.1_t2v_14B_fp16.safetensors","default"]},{"id":48,"type":"ModelSamplingSD3","pos":[249.90524291992188,18.5360164642334],"size":[210,58],"flags":{},"order":8,"mode":0,"inputs":[{"localized_name":"model","name":"model","type":"MODEL","link":94}],"outputs":[{"localized_name":"MODEL","name":"MODEL","type":"MODEL","slot_index":0,"links":[95,96]}],"properties":{"Node name for S&R":"ModelSamplingSD3"},"widgets_values":[8]},{"id":51,"type":"OptimalStepsScheduler","pos":[677.0692749023438,468.3112487792969],"size":[315,106],"flags":{},"order":5,"mode":0,"inputs":[],"outputs":[{"localized_name":"SIGMAS","name":"SIGMAS","type":"SIGMAS","links":[109]}],"properties":{"Node name for S&R":"OptimalStepsScheduler"},"widgets_values":["Wan",20,1]},{"id":28,"type":"SaveAnimatedWEBP","pos":[1466.5548095703125,57.58902359008789],"size":[870.8511352539062,643.7430419921875],"flags":{},"order":11,"mode":0,"inputs":[{"localized_name":"images","name":"images","type":"IMAGE","link":56}],"outputs":[],"properties":{},"widgets_values":["OptimalSteps",16.000000000000004,false,90,"default"]}],"links":[[56,8,0,28,0,"IMAGE"],[74,38,0,6,0,"CLIP"],[75,38,0,7,0,"CLIP"],[76,39,0,8,1,"VAE"],[93,8,0,47,0,"IMAGE"],[94,37,0,48,0,"MODEL"],[96,48,0,49,0,"MODEL"],[97,6,0,49,1,"CONDITIONING"],[98,7,0,49,2,"CONDITIONING"],[99,40,0,49,5,"LATENT"],[100,49,0,8,0,"LATENT"],[101,50,0,49,3,"SAMPLER"],[109,51,0,49,4,"SIGMAS"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.7627768444385539,"offset":[-86.5849925981621,362.13097055336823]}},"version":0.4}
Binary file added wan/text_to_video_wan_OptimalSteps.webp
Binary file not shown.