This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By https://github.com/blepping | |
# License: Apache2 | |
# Initial APG implementation referenced from https://arxiv.org/pdf/2410.02416 and https://github.com/ace-step/ACE-Step/blob/e5610345db9f450a855994169f4ca7a7b5fb4f1d/acestep/apg_guidance.py | |
# | |
# Changes: | |
# 250616: Removed alt2 mode, it was the same as positive momentum. Derp. | |
# 250616: New alt2 mode that blends history with the current diff. Added advanced YAML parameters input. | |
import math | |
import yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By https://github.com/blepping | |
# License: Apache2 | |
# | |
# Usage: Place in ComfyUI's custom_nodes directory. | |
# It will add BlehFlashAttentionSampler and BlehGlobalFlashAttention nodes. | |
# Requires FlashAttention2 installed into the Python venv: https://github.com/Dao-AILab/flash-attention | |
# | |
from __future__ import annotations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
import argparse | |
import mmap | |
import json | |
import os | |
import struct | |
import sys | |
from pathlib import Path | |
from typing import NamedTuple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: Put in custom_nodes and restart ComfyUI/refresh browser. | |
import torch | |
class CosmosSchedulerNode: | |
RETURN_TYPES = ("SIGMAS",) | |
FUNCTION = "go" | |
CATEGORY = "sampling/custom_sampling/schedulers" | |
@classmethod | |
def INPUT_TYPES(cls): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ComfyUI sampler wrapper that saves the state of denoised for every model call. | |
# This ignores whatever the sampler actually returns. You will get a result of | |
# batch_size * times_model_was_called latents. | |
from __future__ import annotations | |
import torch | |
from comfy.samplers import KSAMPLER | |
from comfy.model_management import device_supports_non_blocking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RiftWizard mod, should work with RiftWizard 1 and 2. Usage: | |
# 1. Find your mods directory. Right-click the game -> Properties -> Installed Files -> Browse -> Navigate to RiftWizard2/mods | |
# 2. Create a NoAnnoy directory (case-sensitive) and put NoAnnoy.py in there. | |
# 3. Restart Rift Wizard. You should see a message about the mod in the game console. | |
# | |
# You can use Steam's Launch Options to override settings instead of editing the mod. | |
# Right click the game -> Properties -> General. Example launch string: | |
# NOANNOY_MONSTER_BLACKLIST=SilentSpecter,FaeSniper NOANNOY_GAMEOVER_SPEED_FACTOR=100 %command% | |
### User configurable options: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By https://github.com/blepping/ | |
import torch | |
class SplitMochiVideoLatent: | |
DESCRIPTION = "Hack for Mochi latents to split the frames. Mochi has 6x temporal compression so a latent frame is worth 6 frames in your video. Splitting up a Mochi latent may reduce quality." | |
FUNCTION = "go" | |
CATEGORY = "latent/mochi" | |
RETURN_TYPES = ("LATENT",) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on the concept from https://github.com/muerrilla/sd-webui-detail-daemon | |
# | |
# See DESCRIPTION below for use case/explanation. | |
from __future__ import annotations | |
from typing import TYPE_CHECKING | |
from comfy.samplers import KSAMPLER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial | |
import torch | |
torch.set_printoptions(profile="full") | |
dtype = torch.float64 | |
def randn_like(x, generator=None): | |
return torch.randn(*x.shape, out=x.detach().clone(), generator=generator) |
NewerOlder