Skip to content

Instantly share code, notes, and snippets.

# NO LONGER MAINTAINED
# There is an improved version in my ComfyUI-bleh node pack:
# https://github.com/blepping/ComfyUI-bleh#blehsageattentionsampler
# If you really want to use the gist, see the previous revision.
# Install https://github.com/thu-ml/SageAttention
# Put this file in custom_nodes/ - it will add a SageAttention node.
# NOTES:
# 1. Not an actual model patch, to enable or disable you must ensure the node runs.
# 2. No point in using this for SD15 as none of the dimensions are compatible (it will just delegate).
# 3. It will delegate to the default attention whenever the head dimensions are incompatible or k, v dimensions don't match q.
@if-ai
if-ai / convert_diffusers_to_sd_colab.py
Created October 3, 2022 00:44 — forked from jachiam/convert_diffusers_to_sd_colab.py
Copy and paste this into a colab cell to use the model conversion script
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
import argparse
import os.path as osp
import torch