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
3. **Copy files into ComfyUI**: Copy [`ComfyUI-to-Python-Extension/`](https://github.com/pydn/ComfyUI-to-Python-Extension/tree/main/ComfyUI-to-Python-Extension) into the parent folder of your cloned version of ComfyUI.
124
-
125
-
After copying `ComfyUI-to-Python-Extension/` your local`ComfyUI` directory should look like this:
121
+
After cloning the repo, your `ComfyUI` directory should look like this:
126
122
```
127
123
/comfy
128
124
/comfy_extras
@@ -148,10 +144,26 @@ if __name__ == "__main__":
148
144
server.py
149
145
```
150
146
151
-
4. **Navigate to the `ComfyUI-to-Python-Extension` folder in your local`ComfyUI` directory.**
147
+
3. Navigate to the `ComfyUI-to-Python-Extension` folder and install requirements
148
+
```bash
149
+
pip install -r requirements.txt
150
+
```
151
+
152
+
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!**
153
+
154
+

152
155
153
-
5. **Run the Script**: Use the following command to run the script with a specific JSON file:
156
+
5. Load up your favorite workflows, then click the newly enabled `Save (API Format)` button under Queue Prompt
154
157
158
+
6. Move the downloaded .json workflow file to your `ComfyUI/ComfyUI-to-Python-Extension` folder
159
+
160
+
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 fora file called `workflow_api.json`. You can also update the `queue_size` variable to your desired number of images that you want to generatein a single script execution. By default, the scripts will generate 10 images.
161
+
162
+
8. Run the script:
155
163
```bash
156
-
python generate_python_code.py
157
-
```
164
+
python comfyui_to_python.py
165
+
```
166
+
167
+
9. After truning the `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`.
168
+
169
+
10. Now you can execute the newly created .py file to generate images without launching a server.
0 commit comments