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
# Referenced from https://github.com/FelixKoulischer/Feedback-Guidance-of-Diffusion-Models/ | |
# FBG paper: https://arxiv.org/abs/2506.06085 | |
# ComfyUI implementation by https://github.com/blepping | |
# LICENSE: Apache2 | |
# Usage: Place this file in the custom_nodes directory and restart ComfyUI+refresh browser. | |
# It will add a FBGSampler node that can be used with SamplerCustom, etc. | |
import math | |
from enum import Enum, auto | |
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
# By https://github.com/blepping | |
# License: Apache2 | |
# | |
# Place this file in your custom_nodes directory and it should load automatically. | |
import math | |
import torch | |
SILENCE = torch.tensor(( | |
(-0.6462, -1.2132, -1.3026, -1.2432, -1.2455, -1.2162, -1.2184, -1.2114, -1.2153, -1.2144, -1.2130, -1.2115, -1.2063, -1.1918, -1.1154, -0.7924), |
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 this file in the custom_nodes directory and restart ComfyUI+refresh browser. | |
# It will add a PingPongSampler node that can be used with SamplerCustom, etc. | |
import random | |
import torch | |
from tqdm.auto import trange |
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: | |
# 250617: Fixed broken APG scale parameter handling. | |
# 250516: Removed alt2 mode, it was the same as positive momentum. Derp. | |
# 250516: New alt2 mode that blends history with the current diff. Added advanced YAML parameters input. | |
import math |
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",) |
NewerOlder