Renamed files and updated README and requirements.txt

This commit is contained in:
Peyton
2023-08-07 10:04:58 -05:00
parent 2fc41ddafa
commit b2ce42c22e
4 changed files with 27 additions and 10 deletions
+9 -7
View File
@@ -1,6 +1,6 @@
## Overview
The `ComfyUI-to-Python-Extension` is a powerful tool that translates ComfyUI workflow 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.
The `ComfyUI-to-Python-Extension` is a powerful tool that translates the ComfyUI workflow 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.
**Convert this:**
@@ -14,12 +14,14 @@ import random
import sys
sys.path.append("../")
from nodes import KSamplerAdvanced
from nodes import EmptyLatentImage
from nodes import VAEDecodeTiled
from nodes import SaveImage
from nodes import CheckpointLoaderSimple
from nodes import CLIPTextEncode
from nodes import (
KSamplerAdvanced,
EmptyLatentImage,
VAEDecodeTiled,
SaveImage,
CLIPTextEncode,
CheckpointLoaderSimple,
)
def main():
@@ -3,14 +3,16 @@ import inspect
import json
import logging
import os
from typing import Dict, List, Any, Callable
import sys
import black
from typing import Dict, List, Any, Callable
sys.path.append('../')
from nodes import NODE_CLASS_MAPPINGS
import black
logging.basicConfig(level=logging.INFO)
@@ -218,7 +220,7 @@ def assemble_python_code(import_statements: set, loader_code: List[str], code: L
final_code (str): Generated final code as a string
"""
static_imports = ['import random']
imports_code = [f"from nodes import {class_name}" for class_name in import_statements]
imports_code = [f"from nodes import {', '.join([class_name for class_name in import_statements])}" ]
main_function_code = f"def main():\n\t" + '\n\t'.join(loader_code) + f'\n\n\tfor q in {range(1, queue_size)}:\n\t' + '\n\t'.join(code)
final_code = '\n'.join(static_imports + ['import sys\nsys.path.append("../")'] + imports_code + ['', main_function_code, '', 'if __name__ == "__main__":', '\tmain()'])
final_code = black.format_str(final_code, mode=black.Mode())
+13
View File
@@ -0,0 +1,13 @@
torch
torchdiffeq
torchsde
einops
transformers>=4.25.1
safetensors>=0.3.0
aiohttp
accelerate
pyyaml
Pillow
scipy
tqdm
black