mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-26 00:49:06 +08:00
Add AppendStringsToList
This commit is contained in:
parent
eb8ce5a574
commit
b3e5108ad4
@ -103,6 +103,7 @@ NODE_CONFIG = {
|
|||||||
"GetLatentsFromBatchIndexed": {"class": GetLatentsFromBatchIndexed, "name": "Get Latents From Batch Indexed"},
|
"GetLatentsFromBatchIndexed": {"class": GetLatentsFromBatchIndexed, "name": "Get Latents From Batch Indexed"},
|
||||||
"ScaleBatchPromptSchedule": {"class": ScaleBatchPromptSchedule, "name": "Scale Batch Prompt Schedule"},
|
"ScaleBatchPromptSchedule": {"class": ScaleBatchPromptSchedule, "name": "Scale Batch Prompt Schedule"},
|
||||||
"CameraPoseVisualizer": {"class": CameraPoseVisualizer, "name": "Camera Pose Visualizer"},
|
"CameraPoseVisualizer": {"class": CameraPoseVisualizer, "name": "Camera Pose Visualizer"},
|
||||||
|
"AppendStringsToList": {"class": AppendStringsToList, "name": "Append Strings To List"},
|
||||||
"JoinStrings": {"class": JoinStrings, "name": "Join Strings"},
|
"JoinStrings": {"class": JoinStrings, "name": "Join Strings"},
|
||||||
"JoinStringMulti": {"class": JoinStringMulti, "name": "Join String Multi"},
|
"JoinStringMulti": {"class": JoinStringMulti, "name": "Join String Multi"},
|
||||||
"SomethingToString": {"class": SomethingToString, "name": "Something To String"},
|
"SomethingToString": {"class": SomethingToString, "name": "Something To String"},
|
||||||
|
|||||||
@ -219,6 +219,22 @@ Combines multiple conditioning nodes into one
|
|||||||
cond = cond_concat_node.concat(cond, new_cond)[0]
|
cond = cond_concat_node.concat(cond, new_cond)[0]
|
||||||
return (cond, inputcount,)
|
return (cond, inputcount,)
|
||||||
|
|
||||||
|
class AppendStringsToList:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"string1": ("STRING", {"default": '', "forceInput": True}),
|
||||||
|
"string2": ("STRING", {"default": '', "forceInput": True}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
FUNCTION = "joinstring"
|
||||||
|
CATEGORY = "KJNodes/constants"
|
||||||
|
|
||||||
|
def joinstring(self, string1, string2):
|
||||||
|
joined_string = [string1, string2]
|
||||||
|
return (joined_string, )
|
||||||
|
|
||||||
class JoinStrings:
|
class JoinStrings:
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@ -270,11 +270,11 @@ class SplineEditor{
|
|||||||
this.widthWidget = context.widgets.find(w => w.name === "mask_width");
|
this.widthWidget = context.widgets.find(w => w.name === "mask_width");
|
||||||
this.heightWidget = context.widgets.find(w => w.name === "mask_height");
|
this.heightWidget = context.widgets.find(w => w.name === "mask_height");
|
||||||
|
|
||||||
var interpolation = this.interpolationWidget.value
|
this.interpolation = this.interpolationWidget.value
|
||||||
var tension = this.tensionWidget.value
|
this.tension = this.tensionWidget.value
|
||||||
this.points_to_sample = this.pointsWidget.value
|
this.points_to_sample = this.pointsWidget.value
|
||||||
var rangeMin = this.minValueWidget.value
|
this.rangeMin = this.minValueWidget.value
|
||||||
var rangeMax = this.maxValueWidget.value
|
this.rangeMax = this.maxValueWidget.value
|
||||||
this.pointsLayer = null;
|
this.pointsLayer = null;
|
||||||
this.samplingMethod = this.samplingMethodWidget.value
|
this.samplingMethod = this.samplingMethodWidget.value
|
||||||
|
|
||||||
@ -284,11 +284,11 @@ class SplineEditor{
|
|||||||
|
|
||||||
|
|
||||||
this.interpolationWidget.callback = () => {
|
this.interpolationWidget.callback = () => {
|
||||||
interpolation = this.interpolationWidget.value
|
this.interpolation = this.interpolationWidget.value
|
||||||
this.updatePath();
|
this.updatePath();
|
||||||
}
|
}
|
||||||
this.samplingMethodWidget.callback = () => {
|
this.samplingMethodWidget.callback = () => {
|
||||||
this.samplingMethod = samplingMethodWidget.value
|
this.samplingMethod = this.samplingMethodWidget.value
|
||||||
if (this.samplingMethod == "path") {
|
if (this.samplingMethod == "path") {
|
||||||
this.dotShape = "triangle"
|
this.dotShape = "triangle"
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ class SplineEditor{
|
|||||||
this.updatePath();
|
this.updatePath();
|
||||||
}
|
}
|
||||||
this.tensionWidget.callback = () => {
|
this.tensionWidget.callback = () => {
|
||||||
tension = this.tensionWidget.value
|
this.tension = this.tensionWidget.value
|
||||||
this.updatePath();
|
this.updatePath();
|
||||||
}
|
}
|
||||||
this.pointsWidget.callback = () => {
|
this.pointsWidget.callback = () => {
|
||||||
@ -307,11 +307,11 @@ class SplineEditor{
|
|||||||
this.updatePath();
|
this.updatePath();
|
||||||
}
|
}
|
||||||
this.minValueWidget.callback = () => {
|
this.minValueWidget.callback = () => {
|
||||||
rangeMin = this.minValueWidget.value
|
this.rangeMin = this.minValueWidget.value
|
||||||
this.updatePath();
|
this.updatePath();
|
||||||
}
|
}
|
||||||
this.maxValueWidget.callback = () => {
|
this.maxValueWidget.callback = () => {
|
||||||
rangeMax = this.maxValueWidget.value
|
this.rangeMax = this.maxValueWidget.value
|
||||||
this.updatePath();
|
this.updatePath();
|
||||||
}
|
}
|
||||||
this.widthWidget.callback = () => {
|
this.widthWidget.callback = () => {
|
||||||
@ -428,8 +428,8 @@ this.heightWidget.callback = () => {
|
|||||||
.data(() => this.points)
|
.data(() => this.points)
|
||||||
.left(d => d.x)
|
.left(d => d.x)
|
||||||
.top(d => d.y)
|
.top(d => d.y)
|
||||||
.interpolate(() => interpolation)
|
.interpolate(() => this.interpolation)
|
||||||
.tension(() => tension)
|
.tension(() => this.tension)
|
||||||
.segmented(() => false)
|
.segmented(() => false)
|
||||||
.strokeStyle(pv.Colors.category10().by(pv.index))
|
.strokeStyle(pv.Colors.category10().by(pv.index))
|
||||||
.lineWidth(3)
|
.lineWidth(3)
|
||||||
@ -522,8 +522,8 @@ this.heightWidget.callback = () => {
|
|||||||
if (this.samplingMethod == "path") {
|
if (this.samplingMethod == "path") {
|
||||||
return `X: ${Math.round(d.x)}, Y: ${Math.round(d.y)}`;
|
return `X: ${Math.round(d.x)}, Y: ${Math.round(d.y)}`;
|
||||||
} else {
|
} else {
|
||||||
let frame = Math.round((d.x / self.width) * this.points_to_sample);
|
let frame = Math.round((d.x / self.width) * self.points_to_sample);
|
||||||
let normalizedY = (1.0 - (d.y / self.height) - 0.0) * (rangeMax - rangeMin) + rangeMin;
|
let normalizedY = (1.0 - (d.y / self.height) - 0.0) * (self.rangeMax - self.rangeMin) + self.rangeMin;
|
||||||
let normalizedX = (d.x / self.width);
|
let normalizedX = (d.x / self.width);
|
||||||
return `F: ${frame}, X: ${normalizedX.toFixed(2)}, Y: ${normalizedY.toFixed(2)}`;
|
return `F: ${frame}, X: ${normalizedX.toFixed(2)}, Y: ${normalizedY.toFixed(2)}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user