You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-57Lines changed: 8 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ I also fixed what seemed to be a minor bug with exporting certain Crystools node
46
46
47
47
Disable export of invalid nodes (ones for which required args are not satisfied) and log a warning to the console.
48
48
49
-
## Original Description
49
+
## Description of ComfyUI-to-Python-Extension (usage altered)
50
50
51
51
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.
After cloning the repo, your `ComfyUI` directory should look like this:
182
-
```
183
-
/comfy
184
-
/comfy_extras
185
-
/ComfyUI-to-Python-Extension
186
-
/custom_nodes
187
-
/input
188
-
/models
189
-
/output
190
-
/script_examples
191
-
/web
192
-
.gitignore
193
-
LICENSE
194
-
README.md
195
-
comfyui_screenshot.png
196
-
cuda_mollac.py
197
-
execution.py
198
-
extra_model_paths.yaml.example
199
-
folder_paths.py
200
-
latent_preview.py
201
-
main.py
202
-
nodes.py
203
-
requirements.txt
204
-
server.py
205
-
```
206
-
207
-
3. Navigate to the `ComfyUI-to-Python-Extension` folder and install requirements
208
-
```bash
209
-
pip install -r requirements.txt
210
-
```
211
-
212
-
4. Launch ComfyUI, click the gear icon over `Queue Prompt`, then check `Enable Dev mode Options`. **THE SCRIPT WILL NOT WORK IF YOU DO NOT ENABLE THIS OPTION!**
213
-
214
-

215
-
216
-
5. Load up your favorite workflows, then click the newly enabled `Save (API Format)` button under Queue Prompt
217
-
218
-
6. Move the downloaded .json workflow file to your `ComfyUI/ComfyUI-to-Python-Extension` folder
219
-
220
-
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.
221
-
222
-
8. Run the script:
223
-
```bash
224
-
python comfyui_to_python.py
225
-
```
226
-
227
-
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`.
228
-
229
-
10. Now you can execute the newly created .py file to generate images without launching a server.
174
+
1. Install the custom_node (via git cloning or the Manager)
175
+
176
+
2. Click the button in the web UI OR run the CLI
177
+
178
+
3. Move the created .py file to your `ComfyUI` folder
0 commit comments