-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
632 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from comfy import StableDiffusionModel, VAEModel, CLIPModel, LatentImage, Conditioning | ||
from comfy import CLIPModel, Conditioning, LatentImage, StableDiffusionModel, VAEModel | ||
|
||
__all__ = [ | ||
"StableDiffusionModel", | ||
"VAEModel", | ||
"CLIPModel", | ||
"LatentImage", | ||
"Conditioning", | ||
] | ||
] |
This file contains 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
This file contains 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
30 changes: 30 additions & 0 deletions
30
backend/src/nodes/nodes/stable_diffusion/conditioning_compose.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import annotations | ||
|
||
from ...impl.stable_diffusion.types import Conditioning | ||
from ...node_base import NodeBase | ||
from ...node_factory import NodeFactory | ||
from ...properties.inputs.stable_diffusion_inputs import ConditioningInput | ||
from ...properties.outputs.stable_diffusion_outputs import ConditioningOutput | ||
from . import category as StableDiffusionCategory | ||
|
||
|
||
@NodeFactory.register("chainner:stable_diffusion:conditioning_compose") | ||
class ConditinoingComposeNode(NodeBase): | ||
def __init__(self): | ||
super().__init__() | ||
self.description = "" | ||
self.inputs = [ | ||
ConditioningInput(), | ||
ConditioningInput(), | ||
] | ||
self.outputs = [ | ||
ConditioningOutput(), | ||
] | ||
|
||
self.category = StableDiffusionCategory | ||
self.name = "Compose" | ||
self.icon = "PyTorch" | ||
self.sub = "Conditioning" | ||
|
||
def run(self, a: Conditioning, b: Conditioning) -> Conditioning: | ||
return Conditioning.combine([a, b]) |
82 changes: 82 additions & 0 deletions
82
backend/src/nodes/nodes/stable_diffusion/conditioning_set_area.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from __future__ import annotations | ||
|
||
from ...impl.stable_diffusion.types import Conditioning | ||
from ...node_base import NodeBase | ||
from ...node_factory import NodeFactory | ||
from ...properties.inputs import SliderInput | ||
from ...properties.inputs.stable_diffusion_inputs import ConditioningInput | ||
from ...properties.outputs.stable_diffusion_outputs import ConditioningOutput | ||
from . import category as StableDiffusionCategory | ||
|
||
|
||
@NodeFactory.register("chainner:stable_diffusion:conditioning_set_area") | ||
class ConditinoingComposeNode(NodeBase): | ||
def __init__(self): | ||
super().__init__() | ||
self.description = "" | ||
self.inputs = [ | ||
ConditioningInput(), | ||
SliderInput( | ||
"strength", | ||
minimum=0, | ||
maximum=10, | ||
default=1, | ||
slider_step=0.01, | ||
controls_step=0.01, | ||
), | ||
SliderInput( | ||
"width", | ||
unit="px", | ||
minimum=64, | ||
maximum=4096, | ||
default=512, | ||
slider_step=64, | ||
controls_step=64, | ||
), | ||
SliderInput( | ||
"height", | ||
unit="px", | ||
minimum=64, | ||
maximum=4096, | ||
default=512, | ||
slider_step=64, | ||
controls_step=64, | ||
), | ||
SliderInput( | ||
"x", | ||
unit="px", | ||
minimum=64, | ||
maximum=4096, | ||
default=512, | ||
slider_step=64, | ||
controls_step=64, | ||
), | ||
SliderInput( | ||
"y", | ||
unit="px", | ||
minimum=64, | ||
maximum=4096, | ||
default=512, | ||
slider_step=64, | ||
controls_step=64, | ||
), | ||
] | ||
self.outputs = [ | ||
ConditioningOutput(), | ||
] | ||
|
||
self.category = StableDiffusionCategory | ||
self.name = "Set Area" | ||
self.icon = "PyTorch" | ||
self.sub = "Conditioning" | ||
|
||
def run( | ||
self, | ||
cond: Conditioning, | ||
strength: float, | ||
width: int, | ||
height: int, | ||
x: int, | ||
y: int, | ||
) -> Conditioning: | ||
return cond.set_area(width, height, x, y, strength) |
This file contains 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
This file contains 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
Oops, something went wrong.