Updated How to Contribute Code (markdown)

Alex "mcmonkey" Goodwin 2024-07-01 11:02:39 -07:00
parent 9462e82332
commit 787c138030

@ -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.