Merge pull request #7 from dmarx/dev

documentation
This commit is contained in:
David Marx
2023-12-09 14:06:16 -08:00
committed by GitHub
13 changed files with 83 additions and 6 deletions
+63
View File
@@ -14,10 +14,12 @@ Treat curves/schedules and keyframes as objects that can be passed around, plugg
# Starter Workflows
## Prompt Scheduling
![Prompt Scheduling](examples/prompt-scheduling.png)
## Prompt Interleaving (aka Prompt Entanglement, aka Prompt Superposition)
![Prompt Entanglement](examples/prompt-entanglement.png)
@@ -26,11 +28,72 @@ Which is the node equivalent for achieving this type of thing
![](https://pbs.twimg.com/media/Fqcdhe4agAEnJ-L?format=jpg&name=large)
## Simple Curved Parameter
![Simple Curved Parameter](examples/simple-curved-parameter.png)
## Multi-Prompt Transition With Manually Specified Curves
![Manual Prompt Transition](examples/manual-prompt-transition.png)
# Nodes
## Curve Constructors
### Curve From String
![Curve From String](assets/node_curve-from-string.png)
### Curve From YAML
![Curve From YAML](assets/node_curve-from-yaml.png)
### Constant-Valued Curve
![Curve From YAML](assets/node_constant-valued-curve.png)
## Curve Operators
### Evaluate Curve At T
![Evaluate Curve At T](assets/node_evaluate-curve-at-t.png)
### Apply Curve To Conditioning
![Apply Curve To Conditioning](assets/node_apply-curve-to-conditioning.png)
### Add Conditions
![Apply Curve To Conditioning](assets/node_add-conditions.png)
### Curve Arithmetic Operators
![Curve Arithmetic](assets/nodes_curve-arithmetic.png)
NB: the division operator is unreliable at the time of this writing (2023-12-09).
## Scheduling
### Keyframed Condition
![Keyframed Condition](assets/node_keyframed-condition.png)
### Set Keyframe
![Set Keyframe](assets/node_set-keyframe.png)
### Evaluate Schedule
![Evaluate Schedule](assets/nodes_evaluate-schedule.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+1
View File
@@ -427,4 +427,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"KfCurvesSubtract": "Curve_1 - Curve_2",
"KfCurvesMultiply": "Curve_1 * Curve_2",
"KfCurvesDivide": "Curve_1 / Curve_2",
"KfCurveConstant": "Constant-Valued Curve",
}
+19 -6
View File
@@ -68,17 +68,23 @@ class KfSetKeyframe:
}
}
def main(self, keyframed_condition, schedule=None):
keyframed_condition = deepcopy(keyframed_condition)
cond_dict = keyframed_condition.pop("cond_dict")
cond_dict = deepcopy(cond_dict)
#cond_dict = deepcopy(cond_dict)
if schedule is None:
curve_tokenized = kf.Curve([keyframed_condition["kf_cond_t"]], label="kf_cond_t")
# get a new copy of the tensor
kf_cond_t = keyframed_condition["kf_cond_t"]
#kf_cond_t.value = kf_cond_t.value.clone() # should be redundant with the deepcopy
curve_tokenized = kf.Curve([kf_cond_t], label="kf_cond_t")
curves = [curve_tokenized]
if keyframed_condition["kf_cond_pooled"] is not None:
curve_pooled = kf.Curve([keyframed_condition["kf_cond_pooled"]], label="kf_cond_pooled")
kf_cond_pooled = keyframed_condition["kf_cond_pooled"]
curve_pooled = kf.Curve([kf_cond_pooled], label="kf_cond_pooled")
curves.append(curve_pooled)
schedule = (kf.ParameterGroup(curves), cond_dict)
else:
schedule = deepcopy(schedule)
schedule, old_cond_dict = schedule
for k, v in keyframed_condition.items():
if (v is not None):
@@ -91,6 +97,7 @@ class KfSetKeyframe:
def evaluate_schedule_at_time(schedule, time):
schedule = deepcopy(schedule)
schedule, cond_dict = schedule
#cond_dict = deepcopy(cond_dict)
values = schedule[time]
@@ -98,8 +105,9 @@ def evaluate_schedule_at_time(schedule, time):
cond_pooled = values.get("kf_cond_pooled")
if cond_pooled is not None:
#cond_dict = deepcopy(cond_dict)
cond_dict["pooled_output"] = cond_pooled.clone()
return [(cond_t.clone(), cond_dict)]
cond_dict["pooled_output"] = cond_pooled #.clone()
#return [(cond_t.clone(), cond_dict)]
return [(cond_t, cond_dict)]
class KfGetScheduleConditionAtTime:
@@ -162,4 +170,9 @@ NODE_CLASS_MAPPINGS = {
"KfGetScheduleConditionSlice": KfGetScheduleConditionSlice,
}
NODE_DISPLAY_NAME_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {
"KfKeyframedCondition": "Keyframed Condition",
"KfSetKeyframe": "Set Keyframe",
"KfGetScheduleConditionAtTime": "Evaluate Schedule At T",
"KfGetScheduleConditionSlice": "Evaluate Schedule At T (Batch)",
}