BlehBlockOps: turn off dynamic prompts, fix issue with step calculation

This commit is contained in:
blepping
2024-04-15 16:33:42 -06:00
parent d3f90fb8a6
commit b35ab93f8b
2 changed files with 5 additions and 9 deletions
-2
View File
@@ -121,8 +121,6 @@ SDXL is not going to work at all.
Very experimental advanced node that allows defining model patches using YAML. This node is still under development and may be changed.
**Note**: ComfyUI seems to strip out curly braces so you can't use YAML's inline object notation. You can use `<` and `>` instead.
The top level YAML should consist of a list of objects with a condition `if`, a list of `ops` that run if the condition succeeds.
Objects `then` and `else` also take the same form as the top level object and apply when the `if` condition matches (or not in the case of `else`).
+5 -7
View File
@@ -457,9 +457,7 @@ class Rule:
class RuleGroup:
@classmethod
def from_yaml(cls, s: str, curlybrace_hack=True) -> object:
if curlybrace_hack:
s = s.replace("<", "{").replace(">", "}")
def from_yaml(cls, s: str) -> object:
parsed_rules = yaml.safe_load(s)
return cls(tuple(Rule.from_dict(r)[0] for r in parsed_rules))
@@ -485,7 +483,7 @@ class BlehBlockOps:
return {
"required": {
"model": ("MODEL",),
"rules": ("STRING", {"multiline": True}),
"rules": ("STRING", {"multiline": True, "dynamicPrompts": False}),
},
"optional": {
"sigmas_opt": ("SIGMAS",),
@@ -523,8 +521,8 @@ class BlehBlockOps:
def set_state_step(state, sigma):
if sigmas_opt is None:
state[Condtype.STEP_EXACT] = state[CondType.STEP] = -1
return st
state[CondType.STEP_EXACT] = state[CondType.STEP] = -1
return state
sigmadiff, idx = torch.min(torch.abs(sigmas_opt[:-1] - sigma), 0)
idx = idx.item()
state |= {
@@ -659,7 +657,7 @@ class BlehLatentOps:
return {
"required": {
"samples": ("LATENT",),
"rules": ("STRING", {"multiline": True}),
"rules": ("STRING", {"multiline": True, "dynamicPrompts": False}),
},
}