Skip to content

Commit

Permalink
Merge branch 'master' into add_DetailDaemonSampler_node
Browse files Browse the repository at this point in the history
  • Loading branch information
doombeaker authored Dec 12, 2024
2 parents e71607f + c021d52 commit d1e0542
Show file tree
Hide file tree
Showing 6 changed files with 1,875 additions and 179 deletions.
3 changes: 2 additions & 1 deletion bizyair_example_menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"FLUX ControlNet Canny": "bizyair-flux1-tools-canny.json",
"FLUX ControlNet Depth": "bizyair-flux1-tools-depth.json",
"FLUX Redux": "bizyair-flux1-tools-redux.json",
"FLUX Fill": "bizyair-flux-fill1-inpaint.json"
"FLUX Fill": "bizyair-flux-fill1-inpaint.json",
"FLUX Detail Daemon Sampler": "bizyair_flux_detail_daemon_sampler.json"
},
"ControlNet Union": {
"Generate an image from a line drawing": "bizyair_showcase_interior_design.json",
Expand Down
1 change: 1 addition & 0 deletions bizyair_extras/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .nodes_advanced_refluxcontrol import *
from .nodes_comfyui_detail_daemon import *
from .nodes_comfyui_instantid import *
from .nodes_comfyui_pulid_flux import *
from .nodes_controlnet import *
Expand Down
180 changes: 180 additions & 0 deletions bizyair_extras/nodes_comfyui_detail_daemon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
"""
Reference: https://github.com/Jonseed/ComfyUI-Detail-Daemon
"""

from bizyair import BizyAirBaseNode


class DetailDaemonSamplerNode(BizyAirBaseNode):
DESCRIPTION = "This sampler wrapper works by adjusting the sigma passed to the model, while the rest of sampling stays the same."
CATEGORY = "sampling/custom_sampling/samplers"
RETURN_TYPES = ("SAMPLER",)
# FUNCTION = "go"

NODE_DISPLAY_NAME = "Detail Daemon Sampler"

@classmethod
def INPUT_TYPES(cls) -> dict:
return {
"required": {
"sampler": ("SAMPLER",),
"detail_amount": (
"FLOAT",
{"default": 0.1, "min": -5.0, "max": 5.0, "step": 0.01},
),
"start": (
"FLOAT",
{"default": 0.2, "min": 0.0, "max": 1.0, "step": 0.01},
),
"end": (
"FLOAT",
{"default": 0.8, "min": 0.0, "max": 1.0, "step": 0.01},
),
"bias": (
"FLOAT",
{"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01},
),
"exponent": (
"FLOAT",
{"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.05},
),
"start_offset": (
"FLOAT",
{"default": 0.0, "min": -1.0, "max": 1.0, "step": 0.01},
),
"end_offset": (
"FLOAT",
{"default": 0.0, "min": -1.0, "max": 1.0, "step": 0.01},
),
"fade": (
"FLOAT",
{"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.05},
),
"smooth": ("BOOLEAN", {"default": True}),
"cfg_scale_override": (
"FLOAT",
{
"default": 0,
"min": 0.0,
"max": 100.0,
"step": 0.5,
"round": 0.01,
"tooltip": "If set to 0, the sampler will automatically determine the CFG scale (if possible). Set to some other value to override.",
},
),
},
}


class MultiplySigmas(BizyAirBaseNode):
# FUNCTION = "simple_output"
RETURN_TYPES = ("SIGMAS",)
CATEGORY = "sampling/custom_sampling/sigmas"
NODE_DISPLAY_NAME = "Multiply Sigmas (stateless)"

@classmethod
def INPUT_TYPES(cls) -> dict:
return {
"required": {
"sigmas": ("SIGMAS", {"forceInput": True}),
"factor": (
"FLOAT",
{"default": 1, "min": 0, "max": 100, "step": 0.001},
),
"start": ("FLOAT", {"default": 0, "min": 0, "max": 1, "step": 0.001}),
"end": ("FLOAT", {"default": 1, "min": 0, "max": 1, "step": 0.001}),
}
}


class LyingSigmaSampler(BizyAirBaseNode):
CATEGORY = "sampling/custom_sampling"
RETURN_TYPES = ("SAMPLER",)
NODE_DISPLAY_NAME = "Lying Sigma Sampler"
# FUNCTION = "go"

@classmethod
def INPUT_TYPES(cls) -> dict:
return {
"required": {
"sampler": ("SAMPLER",),
"dishonesty_factor": (
"FLOAT",
{
"default": -0.05,
"min": -0.999,
"step": 0.01,
"tooltip": "Multiplier for sigmas passed to the model. -0.05 means we reduce the sigma by 5%.",
},
),
},
"optional": {
"start_percent": (
"FLOAT",
{"default": 0.1, "min": 0.0, "max": 1.0, "step": 0.01},
),
"end_percent": (
"FLOAT",
{"default": 0.9, "min": 0.0, "max": 1.0, "step": 0.01},
),
},
}


class DetailDaemonGraphSigmasNode(BizyAirBaseNode):
RETURN_TYPES = ()
OUTPUT_NODE = True
CATEGORY = "sampling/custom_sampling/sigmas"
NODE_DISPLAY_NAME = "Detail Daemon Graph Sigmas"
# FUNCTION = "make_graph"

@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"sigmas": ("SIGMAS", {"forceInput": True}),
"detail_amount": (
"FLOAT",
{"default": 0.1, "min": -5.0, "max": 5.0, "step": 0.01},
),
"start": (
"FLOAT",
{"default": 0.2, "min": 0.0, "max": 1.0, "step": 0.01},
),
"end": (
"FLOAT",
{"default": 0.8, "min": 0.0, "max": 1.0, "step": 0.01},
),
"bias": (
"FLOAT",
{"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01},
),
"exponent": (
"FLOAT",
{"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.05},
),
"start_offset": (
"FLOAT",
{"default": 0.0, "min": -1.0, "max": 1.0, "step": 0.01},
),
"end_offset": (
"FLOAT",
{"default": 0.0, "min": -1.0, "max": 1.0, "step": 0.01},
),
"fade": (
"FLOAT",
{"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.05},
),
"smooth": ("BOOLEAN", {"default": True}),
"cfg_scale": (
"FLOAT",
{
"default": 1.0,
"min": 0.0,
"max": 100.0,
"step": 0.5,
"round": 0.01,
},
),
},
}
Loading

0 comments on commit d1e0542

Please sign in to comment.