This node enables better performance for Stable Diffusion models, by leveraging AMD MIGraphX, on Navi3 and Navi4 GPUs.
Supports:
- Stable Diffusion 1.5 (huggingface model)
- Stable Diffusion 2.1 (huggingface model)
- Stable Diffusion 3.0 medium (huggingface model)
- Stable Diffusion 3.5 medium (huggingface model)
- SDXL (huggingface model), (huggingface model)
- Other models to be supported...
To run node with MIGraphX support install:
- ROCm
- PyTorch with ROCm support
- MIGraphX:
sudo apt install migraphxTo run this node you need to install ComfyUI. To manually install clone this repo to ComfyUI/custom_nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/pnikolic-amd/ComfyUI_MIGraphX.git
cd ComfyUI_MIGraphX
pip install -r requirements.txt
export PYTHONPATH=/opt/rocm/lib:$PYTHONPATH
#for best performance
export MIGRAPHX_MLIR_USE_SPECIFIC_OPS="attention"You can find different workflows in the workflows directory. They can be loaded in ComfyUI.
To add MIGraphX node go to toolbar/node library/advanced/migraphx and select "Compile diffusion model on migraphx" node. Connect input model to "Load Checkpoint" node and connect output model to "KSampler" or some other node. Params:
- batch_size, height, width - set same as in Latent image node (testd with 512x512 and 1024x1024).
- context_len - 77 if t5 is not used, 154 if t5 is used.
- data_type - data type that models uses (fp16 for model in example).
