Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3af9964b5a | ||
|
|
c57801e1a1 | ||
|
|
e0e10763e3 |
@@ -8,3 +8,5 @@
|
||||
/dataSources.local.xml
|
||||
/.idea/
|
||||
/__pycache__/
|
||||
|
||||
.DS_Store
|
||||
|
||||
@@ -39,7 +39,7 @@ For example, you have a picture of a green hill with a dark storm. If you want t
|
||||
If you want the storm to be darker, you can mask out the sky. It's kind of annoying to draw two masks, so
|
||||
you can use the same mask, and just change the masked_area option to toggle between grass and sky.
|
||||
|
||||

|
||||

|
||||
|
||||
### HSL Nodes
|
||||
|
||||
@@ -55,7 +55,7 @@ Options:
|
||||
|
||||
For example, you want a spooky haunted house that's glowing red. But whenever you put "red" in the prompt, the house is painted red. You want a house that's dark,
|
||||
you don't want a red house, you want a red glow. But you can turn down the blue and green, and turn up the red.
|
||||

|
||||

|
||||
|
||||
|
||||
#### Levels (HSL)
|
||||
@@ -69,7 +69,7 @@ Options:
|
||||
|
||||
For example, you want a dark landscape, you want it to be green, but stormy. The model can't quite get the lighting on the grass right.
|
||||
|
||||
- 
|
||||
- 
|
||||
|
||||
#### Darken (HSL)
|
||||
|
||||
@@ -80,7 +80,7 @@ Options:
|
||||
- "factor": The amount to darken the image. Shifts the lightness value towards black, a value of 0.5 will adjust the image so that pure white is 50% gray. A value of 1 will make the image completely black. Negative values will lighten the image.
|
||||
|
||||
For example, you want a dark dungeon corridor, but the model always wants it to be SO BRIGHT.
|
||||

|
||||

|
||||
|
||||
#### Lighten (HSL)
|
||||
|
||||
@@ -90,7 +90,7 @@ Options:
|
||||
- "factor": The amount to lighten the image. Shifts the lightness value towards white, a value of 0.5 will adjust the image so that pure black is 50% gray. A value of 1 will make the image completely white. Negative values will darken the image.
|
||||
|
||||
For example, you want a scorching bright desert, but the model LOVES shadows. You don't mind shadows, but they shouldn't be pitch black.
|
||||

|
||||

|
||||
|
||||
#### Saturate (HSL)
|
||||
|
||||
@@ -100,7 +100,7 @@ Options:
|
||||
- "factor": The amount to saturate the image. A value of 0 will leave the image unchanged. A value of 1 will completely saturate the image. Negative values will desaturate the image.
|
||||
|
||||
For example, you want a girl riding through Hobbiton, it's so verdant and lush and green there, and the model wants to go for a different art style.
|
||||

|
||||

|
||||
|
||||
#### Desaturate (HSL)
|
||||
|
||||
@@ -111,7 +111,7 @@ Options:
|
||||
|
||||
For example, you want a girl sitting like a lump in Hobbiton during the Scouring of the Shire, but the model only knows the Shire from the movies,
|
||||
because the model didn't read the books. So it makes a lush green Hobbiton, but you want it to be a bit more desaturated, to match the mood.
|
||||

|
||||

|
||||
|
||||
#### Rotate Hue (HSL)
|
||||
|
||||
@@ -127,7 +127,7 @@ Options:
|
||||
- "degrees": The amount to rotate the hue of the image. A value of 0 will leave the image unchanged. A value of 180 will rotate the hue 180 degrees. Negative values will rotate the hue in the opposite direction.
|
||||
|
||||
For example, you want a universe in a bottle, but when you want a YELLOW universe in the bottle, the model ALWAYS just generates HONEY. NO! You want a UNIVERSE. IN A BOTTLE! YELLOW!
|
||||

|
||||

|
||||
|
||||
### HSV Nodes
|
||||
|
||||
@@ -147,7 +147,7 @@ Options:
|
||||
For example, you want a glowing spooky haunted house in the dead of the night, but the model always wants there to be a well lit mystery light source always from everywhere.
|
||||
The reason you want to use HSV, is because you don't want to desaturate the image, you want to make it darker, but you want the color to remain the same.
|
||||
|
||||

|
||||

|
||||
|
||||
#### Darken (HSV)
|
||||
|
||||
@@ -199,3 +199,9 @@ Options:
|
||||
- "degrees": The amount to rotate the hue of the image. A value of 0 will leave the image unchanged. A value of 180 will rotate the hue 180 degrees. Negative values will rotate the hue in the opposite direction.
|
||||
|
||||
Same uses cases as HSL Rotate Hue, but...honestly I think this might be the exact same thing. Use this if you are a fan of HSV over HSL!
|
||||
|
||||
#### Test Workflow
|
||||
|
||||
This workflow shows every single node, in both masked and unmasked mode.
|
||||
|
||||

|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
from basix_image_filters.hsl_nodes import HSL_NODES
|
||||
from basix_image_filters.hsv_nodes import HSV_NODES
|
||||
from basix_image_filters.rgb_nodes import RGB_NODES
|
||||
from custom_nodes.basix_image_filters.hsl_nodes import HSL_NODES
|
||||
from custom_nodes.basix_image_filters.hsv_nodes import HSV_NODES
|
||||
from custom_nodes.basix_image_filters.rgb_nodes import RGB_NODES
|
||||
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
import torch
|
||||
from torch import Tensor
|
||||
from enum import Enum
|
||||
from basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
from basix_image_filters.hsl_to_rgb import hsl_tensor_to_rgb_tensor
|
||||
from basix_image_filters.rgb_to_hsv import rgb_tensor_to_hsv_tensor
|
||||
from basix_image_filters.hsv_to_rgb import hsv_tensor_to_rgb_tensor
|
||||
from custom_nodes.basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
from custom_nodes.basix_image_filters.hsl_to_rgb import hsl_tensor_to_rgb_tensor
|
||||
from custom_nodes.basix_image_filters.rgb_to_hsv import rgb_tensor_to_hsv_tensor
|
||||
from custom_nodes.basix_image_filters.hsv_to_rgb import hsv_tensor_to_rgb_tensor
|
||||
|
||||
|
||||
class ColorSpace(Enum):
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 MiB |
+2
-2
@@ -1,7 +1,7 @@
|
||||
from torch import Tensor
|
||||
|
||||
from basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from basix_image_filters.image_enhancer_node import ImageEnhancerNode
|
||||
from custom_nodes.basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from custom_nodes.basix_image_filters.image_enhancer_node import ImageEnhancerNode
|
||||
|
||||
hsl_enhancer = ColorEnhancer(ColorSpace.HSL)
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
from torch import Tensor
|
||||
|
||||
from basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from basix_image_filters.image_enhancer_node import ImageEnhancerNode
|
||||
from custom_nodes.basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from custom_nodes.basix_image_filters.image_enhancer_node import ImageEnhancerNode
|
||||
|
||||
hsv_enhancer = ColorEnhancer(ColorSpace.HSV)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Optional
|
||||
import torch
|
||||
from torch import Tensor
|
||||
|
||||
from basix_image_filters.filter_util import composite_by_mask
|
||||
from custom_nodes.basix_image_filters.filter_util import composite_by_mask
|
||||
|
||||
|
||||
def as_list(image: Tensor | list[Tensor] | None) -> list[Tensor] | None:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "basix_image_filters"
|
||||
description = "A handful of image filters for ComfyUI (darken, lighten, levels, saturate, hue)"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
license = {file = "LICENSE"}
|
||||
|
||||
[project.urls]
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
from torch import Tensor
|
||||
|
||||
from basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace, RGBChannels
|
||||
from basix_image_filters.image_enhancer_node import ImageEnhancerNode
|
||||
from custom_nodes.basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace, RGBChannels
|
||||
from custom_nodes.basix_image_filters.image_enhancer_node import ImageEnhancerNode
|
||||
|
||||
rgb_enhancer = ColorEnhancer(ColorSpace.RGB)
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@ import unittest
|
||||
import torch
|
||||
from torch import Tensor
|
||||
|
||||
# Assuming the color_enhancer.py is in the same directory or properly installed as a module
|
||||
from basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from custom_nodes.basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
|
||||
|
||||
class TestColorEnhancer(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
import torch
|
||||
from basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from custom_nodes.basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
|
||||
|
||||
class TestHSLEnhancer(unittest.TestCase):
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from basix_image_filters.hsl_to_rgb import hsl_tensor_to_rgb_tensor
|
||||
from basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
from custom_nodes.basix_image_filters.hsl_to_rgb import hsl_tensor_to_rgb_tensor
|
||||
from custom_nodes.basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
|
||||
|
||||
class TestHSLToRGBColorConversion(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
import torch
|
||||
from basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
from custom_nodes.basix_image_filters.color_enhancer import ColorEnhancer, ColorSpace
|
||||
|
||||
|
||||
class TestHSVEnhancer(unittest.TestCase):
|
||||
|
||||
+2
-9
@@ -2,15 +2,8 @@ import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from basix_image_filters.hsv_to_rgb import hsv_tensor_to_rgb_tensor
|
||||
from basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
|
||||
import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from basix_image_filters.hsv_to_rgb import hsv_tensor_to_rgb_tensor
|
||||
from basix_image_filters.rgb_to_hsv import rgb_tensor_to_hsv_tensor
|
||||
from custom_nodes.basix_image_filters.hsv_to_rgb import hsv_tensor_to_rgb_tensor
|
||||
from custom_nodes.basix_image_filters.rgb_to_hsv import rgb_tensor_to_hsv_tensor
|
||||
|
||||
|
||||
class TestHSVToRGBColorConversion(unittest.TestCase):
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
from custom_nodes.basix_image_filters.rgb_to_hsl import rgb_tensor_to_hsl_tensor
|
||||
|
||||
|
||||
class TestRgbToHslConversion(unittest.TestCase):
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from basix_image_filters.rgb_to_hsv import rgb_tensor_to_hsv_tensor
|
||||
from custom_nodes.basix_image_filters.rgb_to_hsv import rgb_tensor_to_hsv_tensor
|
||||
|
||||
|
||||
class TestRgbToHsvConversion(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user