diff --git a/README.md b/README.md index 0ac7895..0cced85 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,15 @@ set them to `null` (`None`). These are some example workflows, in simple and exploded forms (where by “exploded” I mean “each step done separately”). +[GLM-Image](workflows/hf_glm_image.json) ([exploded])(workflows/hf_glm_image_exploded.json)) +(Note: As of the writing of this README, requires the git version of both Diffusers and Transformers.) + +![GLM-Image](workflows/hf_glm_image.webp) +![GLM-Image, exploded](workflows/hf_glm_image_exploded.webp) + [LongCat Image](workflows/hf_longcat_image.json) ([exploded](workflows/hf_longcat_image_exploded.json)) +(Note: Requires [my PR](https://github.com/huggingface/diffusers/pull/12963) to +use quantization.) ![LongCat Image](workflows/hf_longcat_image.webp) ![LongCat Image, exploded](workflows/hf_longcat_image_exploded.webp) diff --git a/workflows/hf_glm_image.json b/workflows/hf_glm_image.json new file mode 100644 index 0000000..dd32b8e --- /dev/null +++ b/workflows/hf_glm_image.json @@ -0,0 +1,260 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 18, + "last_link_id": 20, + "nodes": [ + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1380, + 320 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 19 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": null + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": null + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "GlmImagePipeline", + "zai-org/GLM-Image", + "default", + false, + "bitsandbytes_4bit", + "" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 320 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 19 + ] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": null + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "", + 1152, + 896, + 1, + "fixed", + 20, + "pil", + "{\"guidance_scale\": 0}" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 19, + 16, + 0, + 17, + 0, + "PIL_IMAGE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 1.263157894736842, + "offset": [ + -480, + -140.1875 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_glm_image.webp b/workflows/hf_glm_image.webp new file mode 100644 index 0000000..46f0cc9 Binary files /dev/null and b/workflows/hf_glm_image.webp differ diff --git a/workflows/hf_glm_image_exploded.json b/workflows/hf_glm_image_exploded.json new file mode 100644 index 0000000..535f838 --- /dev/null +++ b/workflows/hf_glm_image_exploded.json @@ -0,0 +1,348 @@ +{ + "id": "7a0a3329-0419-4e36-8338-9c7ad94c6845", + "revision": 0, + "last_node_id": 22, + "last_link_id": 32, + "nodes": [ + { + "id": 18, + "type": "SaveImage", + "pos": [ + 1530, + 320 + ], + "size": [ + 270, + 270 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 20 + } + ], + "outputs": [], + "properties": {}, + "widgets_values": [ + "ComfyUI" + ] + }, + { + "id": 17, + "type": "PILToImage", + "pos": [ + 1370, + 410 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "PIL_IMAGE", + "link": 32 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 20 + ] + } + ], + "properties": { + "Node name for S&R": "PILToImage" + }, + "widgets_values": [] + }, + { + "id": 15, + "type": "HFDLoadPipeline", + "pos": [ + 680, + 320 + ], + "size": [ + 314.6333312988281, + 198 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "vae", + "shape": 7, + "type": "HFD_AUTOENCODERKL", + "link": 21 + }, + { + "name": "text_encoder", + "shape": 7, + "type": "HFT_MODEL", + "link": 22 + } + ], + "outputs": [ + { + "name": "HFD_PIPELINE", + "type": "HFD_PIPELINE", + "links": [ + 18 + ] + }, + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [] + } + ], + "properties": { + "Node name for S&R": "HFDLoadPipeline" + }, + "widgets_values": [ + "GlmImagePipeline", + "zai-org/GLM-Image", + "default", + false, + "bitsandbytes_4bit", + "" + ] + }, + { + "id": 19, + "type": "HFDAutoencoderKL", + "pos": [ + 300, + 320 + ], + "size": [ + 362.58331909179685, + 178 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFD_AUTOENCODERKL", + "type": "HFD_AUTOENCODERKL", + "links": [ + 21 + ] + } + ], + "properties": { + "Node name for S&R": "HFDAutoencoderKL" + }, + "widgets_values": [ + "AutoencoderKL", + "zai-org/GLM-Image", + "vae", + "default", + "bitsandbytes_4bit", + "" + ] + }, + { + "id": 20, + "type": "HFTAutoModel", + "pos": [ + 300, + 540 + ], + "size": [ + 348.5500030517578, + 178 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "HFT_MODEL", + "type": "HFT_MODEL", + "links": [ + 22 + ] + } + ], + "properties": { + "Node name for S&R": "HFTAutoModel" + }, + "widgets_values": [ + "T5EncoderModel", + "zai-org/GLM-Image", + "text_encoder", + "default", + "bitsandbytes_4bit", + "" + ] + }, + { + "id": 16, + "type": "HFDRunPipeline", + "pos": [ + 1010, + 500 + ], + "size": [ + 357.61667251586914, + 390 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "pipeline", + "type": "HFD_PIPELINE", + "link": 18 + }, + { + "name": "image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "mask_image", + "shape": 7, + "type": "PIL_IMAGE", + "link": null + }, + { + "name": "latents", + "shape": 7, + "type": "LATENT", + "link": null + }, + { + "name": "prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + }, + { + "name": "negative_pooled_prompt_embeds", + "shape": 7, + "type": "TENSOR", + "link": null + } + ], + "outputs": [ + { + "name": "PIL_IMAGE", + "type": "PIL_IMAGE", + "links": [ + 32 + ] + }, + { + "name": "LATENT", + "type": "LATENT", + "links": [] + } + ], + "properties": { + "Node name for S&R": "HFDRunPipeline" + }, + "widgets_values": [ + "a photo of an astronaut riding a horse on mars", + "", + 1152, + 896, + 1, + "fixed", + 20, + "pil", + "{\"guidance_scale\": 0}" + ] + } + ], + "links": [ + [ + 18, + 15, + 0, + 16, + 0, + "HFD_PIPELINE" + ], + [ + 20, + 17, + 0, + 18, + 0, + "IMAGE" + ], + [ + 21, + 19, + 0, + 15, + 0, + "HFD_AUTOENCODERKL" + ], + [ + 22, + 20, + 0, + 15, + 1, + "HFT_MODEL" + ], + [ + 32, + 16, + 0, + 17, + 0, + "PIL_IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.9473684210526314, + "offset": [ + -36.66666666666663, + -110.25 + ] + }, + "frontendVersion": "1.35.9", + "workflowRendererVersion": "LG", + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/hf_glm_image_exploded.webp b/workflows/hf_glm_image_exploded.webp new file mode 100644 index 0000000..0972c6e Binary files /dev/null and b/workflows/hf_glm_image_exploded.webp differ