|
1 | 1 | ## ComfyUI-to-Python-Extension
|
2 | 2 |
|
3 |
| -The `ComfyUI-to-Python-Extension` is a powerful tool that translates [ComfyUI](https://github.com/comfyanonymous/ComfyUI) workflows into executable Python code. Designed to bridge the gap between ComfyUI's visual interface and Python's programming environment, this script facilitates the seamless transition from design to code execution. Whether you're a data scientist, a software developer, or an AI enthusiast, this tool streamlines the process of implementing ComfyUI workflows in Python. The output makes it easy to queue a large amount of images for generation and provides a base script to easily modify for experimination. |
| 3 | +The `ComfyUI-to-Python-Extension` is a powerful tool that translates [ComfyUI](https://github.com/comfyanonymous/ComfyUI) workflows into executable Python code. Designed to bridge the gap between ComfyUI's visual interface and Python's programming environment, this script facilitates the seamless transition from design to code execution. Whether you're a data scientist, a software developer, or an AI enthusiast, this tool streamlines the process of implementing ComfyUI workflows in Python. |
4 | 4 |
|
5 | 5 | **Convert this:**
|
6 | 6 |
|
@@ -109,6 +109,11 @@ def main():
|
109 | 109 | if __name__ == "__main__":
|
110 | 110 | main()
|
111 | 111 | ```
|
| 112 | +## Potential Use Cases |
| 113 | +- Streamlining the process for creating a lean app or pipeline deployment that uses a ComfyUI workflow |
| 114 | +- Creating programmatic experiments for various prompt/parameter values |
| 115 | +- Creating large queues for image generation (For example, you could adjust the script to generate 1000 images without clicking ctrl+enter 1000 times) |
| 116 | +- Easily expanding or iterating on your architecture in Python once a foundational workflow is in place in the GUI |
112 | 117 |
|
113 | 118 | ## V1.0.0 Release Notes
|
114 | 119 | - **Use all the custom nodes!**
|
@@ -164,13 +169,13 @@ if __name__ == "__main__":
|
164 | 169 |
|
165 | 170 | 6. Move the downloaded .json workflow file to your `ComfyUI/ComfyUI-to-Python-Extension` folder
|
166 | 171 |
|
167 |
| -7. If needed, update the `input` variable at the bottom of `comfyui_to_python.py` to match the name of your .json workflow file. By default, the script will look for a file called `workflow_api.json`. You can also update the `queue_size` variable to your desired number of images that you want to generate in a single script execution. By default, the scripts will generate 10 images. |
| 172 | +7. If needed, update the `input_file` and `output_file` variables at the bottom of `comfyui_to_python.py` to match the name of your .json workflow file and desired .py file name. By default, the script will look for a file called `workflow_api.json`. You can also update the `queue_size` variable to your desired number of images that you want to generate in a single script execution. By default, the scripts will generate 10 images. |
168 | 173 |
|
169 | 174 | 8. Run the script:
|
170 | 175 | ```bash
|
171 | 176 | python comfyui_to_python.py
|
172 | 177 | ```
|
173 | 178 |
|
174 |
| -9. After running `comfyui_to_python.py`, a new .py file will be created in the current working directory that contains the same name as the `input` variable. If you made no changes, look for `workflow_api.py`. |
| 179 | +9. After running `comfyui_to_python.py`, a new .py file will be created in the current working directory. If you made no changes, look for `workflow_api.py`. |
175 | 180 |
|
176 | 181 | 10. Now you can execute the newly created .py file to generate images without launching a server.
|
0 commit comments