Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nodes rf inversion #275

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions bizyair_extras/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .nodes_advanced_refluxcontrol import *
from .nodes_comfyui_detail_daemon import *
from .nodes_comfyui_instantid import *
from .nodes_comfyui_pulid_flux import *
from .nodes_comfyui_rf_inversion import *
from .nodes_controlnet import *
from .nodes_custom_sampler import *
from .nodes_differential_diffusion import *
Expand Down
66 changes: 66 additions & 0 deletions bizyair_extras/nodes_comfyui_detail_daemon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"""
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.",
},
),
},
}
155 changes: 155 additions & 0 deletions bizyair_extras/nodes_comfyui_rf_inversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
"""
Reference: https://github.com/Jonseed/ComfyUI-Detail-Daemon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个参考地址没改成 rf 的

"""

import nodes
from bizyair import BizyAirBaseNode, data_types


class OutFluxModelSamplingPred(BizyAirBaseNode):
DESCRIPTION = ""
RETURN_TYPES = (data_types.MODEL,)
NODE_DISPLAY_NAME = "Outverse Flux Model Pred"
CATEGORY = "sampling/custom_sampling/samplers"

@classmethod
def INPUT_TYPES(s):
return {
"required": {
"model": (data_types.MODEL,),
"max_shift": (
"FLOAT",
{"default": 1.15, "min": 0.0, "max": 100.0, "step": 0.01},
),
"base_shift": (
"FLOAT",
{"default": 0.5, "min": 0.0, "max": 100.0, "step": 0.01},
),
"width": (
"INT",
{
"default": 1024,
"min": 16,
"max": nodes.MAX_RESOLUTION,
"step": 8,
},
),
"height": (
"INT",
{
"default": 1024,
"min": 16,
"max": nodes.MAX_RESOLUTION,
"step": 8,
},
),
"reverse_ode": ("BOOLEAN", {"default": False}),
}
}


class InFluxModelSamplingPred(BizyAirBaseNode):
RETURN_TYPES = (data_types.MODEL,)
CATEGORY = "sampling/custom_sampling/samplers"
NODE_DISPLAY_NAME = "Inverse Flux Model Pred"

@classmethod
def INPUT_TYPES(s):
return {
"required": {
"model": (data_types.MODEL,),
"max_shift": (
"FLOAT",
{"default": 1.15, "min": 0.0, "max": 100.0, "step": 0.01},
),
"base_shift": (
"FLOAT",
{"default": 0.5, "min": 0.0, "max": 100.0, "step": 0.01},
),
"width": (
"INT",
{
"default": 1024,
"min": 16,
"max": nodes.MAX_RESOLUTION,
"step": 8,
},
),
"height": (
"INT",
{
"default": 1024,
"min": 16,
"max": nodes.MAX_RESOLUTION,
"step": 8,
},
),
}
}


class FluxForwardODESampler(BizyAirBaseNode):
RETURN_TYPES = ("SAMPLER",)
# FUNCTION = "build"
CATEGORY = "sampling/custom_sampling/samplers"
NODE_DISPLAY_NAME = "Flux Forward ODE Sampler"

@classmethod
def INPUT_TYPES(s):
return {
"required": {
"gamma": (
"FLOAT",
{"default": 0.5, "min": 0.0, "max": 100.0, "step": 0.01},
),
},
"optional": {
"seed": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFFFFFFFFFFFF}),
},
}


class FluxReverseODESampler(BizyAirBaseNode):
RETURN_TYPES = ("SAMPLER",)
# FUNCTION = "build"
CATEGORY = "sampling/custom_sampling/samplers"
NODE_DISPLAY_NAME = "Flux Reverse ODE Sampler"

@classmethod
def INPUT_TYPES(s):
return {
"required": {
"model": (data_types.MODEL,),
"latent_image": ("LATENT",),
"eta": (
"FLOAT",
{"default": 0.8, "min": 0.0, "max": 100.0, "step": 0.01},
),
"start_step": ("INT", {"default": 0, "min": 0, "max": 1000, "step": 1}),
"end_step": ("INT", {"default": 5, "min": 0, "max": 1000, "step": 1}),
},
"optional": {
"eta_trend": (["constant", "linear_increase", "linear_decrease"],)
},
}


class FluxDeGuidance(BizyAirBaseNode):

RETURN_TYPES = (data_types.CONDITIONING,)
# FUNCTION = "append"

CATEGORY = "fluxtapoz"
NODE_DISPLAY_NAME = "Flux DeGuidance"

@classmethod
def INPUT_TYPES(s):
return {
"required": {
"conditioning": (data_types.CONDITIONING,),
"guidance": (
"FLOAT",
{"default": 3.5, "min": -100.0, "max": 100.0, "step": 0.1},
),
}
}
Loading
Loading