| 7 | |
| 8 | |
| 9 | def blur_internal(image, blur_radius): |
| 10 | if blur_radius > 0: |
| 11 | # https://docs.opencv.org/2.4/modules/imgproc/doc/filtering.html#getgaussiankernel |
| 12 | # sigma = 0.3 * blur_radius + 0.5 is what is recommended in the OpenCV doc for the |
| 13 | # relationship between sigma and kernel size 2*blur_radius + 1, however we want somewhat weaker |
| 14 | # blurring, so we use 0.3 * blur_radius instead, reducing the sigma value by 0.5 |
| 15 | sigma = 0.3 * blur_radius |
| 16 | image = post_processing.Blur.execute(image, blur_radius, sigma)[0] |
| 17 | return image |
| 18 | |
| 19 | |
| 20 | @comfy_node(name="LTXVAddGuideAdvanced") |