ComfyUI Node
Safe Function
Runs a restricted Python-like function. Parameters bind to the sockets positionally: the first parameter reads a, the second b, and so on. Sockets are lazy, so a socket the body never reaches is never produced.
Safe Function
- a
- b
- c
- d
- e
- f
- g
- h
- i
- j
- k
- l
- result
◄sourcedef main(original: IMAGE, restored: IMAGE, enabled: BOOL = True, strength: FLOAT = 1.0) -> IMAGE:
if not enabled:
return original
if strength <= 0:
return original
return restored
►
◄max_iterations1000►
◄max_ops50000►
◄max_calls5000►
◄max_collection10000►
◄max_tensor_elements100000000►
CategoryMAINodes/Flow
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| source | STRING | def main(original: IMAGE, restored: IMAGE, enabled: BOOL = True, strength: FLOAT = 1.0) -> IMAGE: if not enabled: return original if strength <= 0: return original return restored | — |
| max_iterations | INT | 10001–100000000 | — |
| max_ops | INT | 500001–100000000 | — |
| max_calls | INT | 50001–100000000 | — |
| max_collection | INT | 100001–100000000 | — |
| max_tensor_elements | INT | 1000000001–1000000000 | — |
| aopt | * | parameter 1 | |
| bopt | * | parameter 2 | |
| copt | * | parameter 3 | |
| dopt | * | parameter 4 | |
| eopt | * | parameter 5 | |
| fopt | * | parameter 6 | |
| gopt | * | parameter 7 | |
| hopt | * | parameter 8 | |
| iopt | * | parameter 9 | |
| jopt | * | parameter 10 | |
| kopt | * | parameter 11 | |
| lopt | * | parameter 12 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | * | — |