ComfyUI Node
Griptape Code: Run Python [DEPRECATED]
Executes python code as a task. The code takes the `input` from the task and should define an `output` variable that will be returned as the task's output.
Griptape Code: Run Python [DEPRECATED]
- agent
- OUTPUT
- AGENT
◄inputThis text will be passed as `input` to the code.►
◄examplesCustom code►
◄code# Python code to execute.
# `input` is any input text.
# `output` will be returned as the task output
output = input.upper()
►
CategoryGriptape/Code
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| input | STRING | This text will be passed as `input` to the code. | — |
| agentopt | AGENT | — | |
| examplesopt | COMBO | Custom code | Select an example code snippet to replace the default code. |
| codeopt | STRING | # Python code to execute. # `input` is any input text. # `output` will be returned as the task output output = input.upper() | Python code to execute. The code should define an `output` variable that will be returned as the task's output. Example: # Sorts a list of numbers def sort_numbers(numbers): return sorted(numbers) output = str(sort_numbers([int(x) for x in input.split(',')])) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| OUTPUT | STRING | — |
| AGENT | AGENT | — |