Closed btaens closed 1 month ago
@btaens How about i put a rawInput method that bypass typing ? So we can set any key we want into the workflow
Yeah, I think something like that is probably the best that can be done for this use case.
I have add setRawInputNode
appendRawInputNode
and setRawOutputNode
, this will allow string as mapping key; and every setInput and output will return clone of current PromptBuilder. Hope it can help
Hmm, while it allows setting of arbitrary node values, it still expects it to be one of the predefined parameters, so a variable amount of inputs is still an issue.
Hmm, while it allows setting of arbitrary node values, it still expects it to be one of the predefined parameters, so a variable amount of inputs is still an issue.
Lol, i forgot about it, let me quick fix!
Maybe a simple .rawInput function at prompting, so you can just set an arbitrary node to a value if you need it?
Maybe a simple .rawInput function at prompting, so you can just set an arbitrary node to a value if you need it?
I think, allow to create undefined path in input
method is enough, when using with default setInputNode
, typescript lint already tell the error if it not correct the path. Please try again with latest version
@btaens also i have put the inputRaw
method so we can bind value directly into any key
The typing still expects an typeof PromptBuilder
instead of just PromptBuilder<I, O, T>
, modifying index.d.ts seems to confirm this as it works perfectly afterwards.
Thank you, i have push a fix for jsdoc and typing, can you recheck again
Yeah, works perfectly! Thanks for the quick response!
In ComfyUI, there's some nodes with a variable amount of inputs, such as Power Lora Loader from rgthree. I'm not exactly sure what a good solution for this would look like, as unfortunately these don't even take a simple object as their nodes, but a pattern of node endpoints, in the case of Power Lora, every lora you add would look something like this:
26.inputs.lora_1
,26.inputs.lora_2
,26.inputs.lora_3
et cetera, each of which takes an object with multiple properties.Again, not sure how to implement this with the current predefined PromptBuilder inputs if the amount of inputs we receive is also variable. Maybe some deeper level .input method that allows the setting of arbitrary values. I guess you could just set the .setInputNode for such fields at request time and create a new instance of PromptBuilder for each generation, but that would kind of make the point of PromptBuilder moot in this use case.