Skip to content

Instantly share code, notes, and snippets.

View laksjdjf's full-sized avatar
🌏
On Earth

laksjdjf

🌏
On Earth
View GitHub Profile
import comfy
from comfy.samplers import KSAMPLER
import torch
from torchvision.transforms.functional import gaussian_blur
from comfy.k_diffusion.sampling import default_noise_sampler, get_ancestral_step, to_d, BrownianTreeNoiseSampler
from tqdm.auto import trange
def interpolate(x, size, unsharp_strength=0.0, unsharp_kernel_size=3, unsharp_sigma=0.5, unsharp=False, mode="bicubic", align_corners=False):
x = torch.nn.functional.interpolate(x, size=size, mode=mode, align_corners=align_corners)
if unsharp_strength > 0 and unsharp: