From 787c138030b4dc8259fa716ced2aa65773eb7afd Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" <4000772+mcmonkey4eva@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:02:39 -0700 Subject: [PATCH] Updated How to Contribute Code (markdown) --- How-to-Contribute-Code.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/How-to-Contribute-Code.md b/How-to-Contribute-Code.md index 273e335..d9564fa 100644 --- a/How-to-Contribute-Code.md +++ b/How-to-Contribute-Code.md @@ -5,16 +5,18 @@ For general improvements/bug fixes just make a pull request. Try to make a singl ## Special Cases -### Adding support for new models +### Adding support for new model architectures -If you want us to add support for a new model to ComfyUI what we need is: +Checklist of requirements for a PR that adds support for a new model architecture: -- Have a minimal implementation of the model code that only depends on pytorch under a license compatible with the GPL license that ComfyUI uses. -- Provide a reference image with sampling settings/seed/etc.. so that I can make sure the ComfyUI implementation matches the reference one. -- Replace all attention functions with the comfyui "optimized_attention" attention function -- If possible, please release your primary models in `.safetensor` file format. +- Have a minimal implementation of the model code that only depends on pytorch under a license compatible with the [GPL license that ComfyUI uses](https://github.com/comfyanonymous/ComfyUI/blob/master/LICENSE). +- Provide a reference image with sampling settings/seed/etc. so that we can make sure the ComfyUI implementation matches the reference one. +- Replace all attention functions with the comfyui `optimized_attention` attention function. +- If you are the part of the team that authored the model architecture itself: + - Please release your primary models in `.safetensors` file format, not legacy `.ckpt` pickle files. + - Please include [proper identifying metadata](https://github.com/Stability-AI/ModelSpec) in the header of the file. -Example of the sdpa implementation: +Example of the SDPA implementation: ``` def optimized_attention(q, k, v, heads, mask=None, attn_precision=None, skip_reshape=False): @@ -43,4 +45,4 @@ Examples in the Code: [mmdit](https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/ldm/modules/diffusionmodules/mmdit.py#L293) -After that you can just ping me: "comfyanonymous" on [matrix](https://app.element.io/#/room/%23comfyui_space%3Amatrix.org) or "comfy" on [discord](https://discord.com/invite/comfyorg) and I can take a look. +After that you can just ping `comfyanonymous` on [matrix](https://app.element.io/#/room/%23comfyui_space%3Amatrix.org) or `@comfyanon` on [discord](https://discord.gg/comfyorg) and he will take a look.