Giter Club home page Giter Club logo

Comments (4)

GrimblyGorn avatar GrimblyGorn commented on May 25, 2024

I stuck this code in the nodes.py file:

class ConstFloat:
    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {"n": ("FLOAT", {"multiline": True, "dynamic_prompt": True, "default": 1.0, "min": -512.0, "max": 512.0})}}

    RETURN_TYPES = ("FLOAT",)
    FUNCTION = "set_float"
    CATEGORY = "Constants"

    def set_float(self, n):
        return (n,)

class ConstInt:
    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {"n": ("INT", {"multiline": True, "dynamic_prompt": True, "default": 1, "min": -512, "max": 512})}}

    RETURN_TYPES = ("INT",)
    FUNCTION = "set_int"
    CATEGORY = "Constants"

    def set_int(self, n):
        return (n,)

class ConstString:
    @classmethod
    def INPUT_TYPES(cls):
        return {"required": {"n": ("STRING", {"multiline": True, "dynamic_prompt": True, "default": ""})}}

    RETURN_TYPES = ("STRING",)
    FUNCTION = "set_string"
    CATEGORY = "Constants"

    def set_string(self, n):
        return (n,)

I stuck it in just above this "NODE_CLASS_MAPPINGS = { "KSampler": KSampler,...".

Then at the bottom of the NODE_CLASS_MAPPINGS list, I extended it with these:

    "ConstFloat": ConstFloat,
    "ConstInt": ConstInt,
    "ConstString": ConstString,

They seem to work fine so far. Likely my hacked together code could be improved, but this should get you started.

from comfyui.

jordanbtucker avatar jordanbtucker commented on May 25, 2024

Piggybacking on this idea, it would be great if these nodes had inputs and outputs for parameters like seed. That way, one sampler could generate a random seed and pass that on to additional samplers.

from comfyui.

WASasquatch avatar WASasquatch commented on May 25, 2024

Piggybacking on this idea, it would be great if these nodes had inputs and outputs for parameters like seed. That way, one sampler could generate a random seed and pass that on to additional samplers.

Yeah this is a important feature for like HR fix workflows to retain the overall theme without it going too rogue on HR pass.

from comfyui.

comfyanonymous avatar comfyanonymous commented on May 25, 2024

Fixed with: #243

from comfyui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.