|
|
|
@ -5,6 +5,7 @@ from PIL import Image
|
|
|
|
|
import math |
|
|
|
|
|
|
|
|
|
import comfy.utils |
|
|
|
|
import comfy.model_management |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Blend: |
|
|
|
@ -102,6 +103,7 @@ class Blur:
|
|
|
|
|
if blur_radius == 0: |
|
|
|
|
return (image,) |
|
|
|
|
|
|
|
|
|
image = image.to(comfy.model_management.get_torch_device()) |
|
|
|
|
batch_size, height, width, channels = image.shape |
|
|
|
|
|
|
|
|
|
kernel_size = blur_radius * 2 + 1 |
|
|
|
@ -112,7 +114,7 @@ class Blur:
|
|
|
|
|
blurred = F.conv2d(padded_image, kernel, padding=kernel_size // 2, groups=channels)[:,:,blur_radius:-blur_radius, blur_radius:-blur_radius] |
|
|
|
|
blurred = blurred.permute(0, 2, 3, 1) |
|
|
|
|
|
|
|
|
|
return (blurred,) |
|
|
|
|
return (blurred.to(comfy.model_management.intermediate_device()),) |
|
|
|
|
|
|
|
|
|
class Quantize: |
|
|
|
|
def __init__(self): |
|
|
|
|