From c0befe3e45110eb44fe958060ea8907e85ee5cff Mon Sep 17 00:00:00 2001 From: saltacc Date: Fri, 19 Jan 2024 12:54:07 -0800 Subject: [PATCH] merge master --- .gitmodules | 3 + image_generation/ComfyLauncher/ComfyRunner.py | 21 +++++ image_generation/ComfyLauncher/README.md | 0 image_generation/ComfyLauncher/prompt.json | 86 +++++++++++++++++++ .../ComfyLauncher/send_request.py | 0 image_generation/ComfyUI | 1 + 6 files changed, 111 insertions(+) create mode 100644 image_generation/ComfyLauncher/ComfyRunner.py create mode 100644 image_generation/ComfyLauncher/README.md create mode 100644 image_generation/ComfyLauncher/prompt.json create mode 100644 image_generation/ComfyLauncher/send_request.py create mode 160000 image_generation/ComfyUI diff --git a/.gitmodules b/.gitmodules index 7bea069..7f3c1e7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "animation/rerender-lora/deps/gmflow"] path = animation/rerender-lora/deps/gmflow url = https://github.com/haofeixu/gmflow.git +[submodule "image_generation/ComfyUI"] + path = image_generation/ComfyUI + url = https://github.com/comfyanonymous/ComfyUI.git diff --git a/image_generation/ComfyLauncher/ComfyRunner.py b/image_generation/ComfyLauncher/ComfyRunner.py new file mode 100644 index 0000000..7d42b1b --- /dev/null +++ b/image_generation/ComfyLauncher/ComfyRunner.py @@ -0,0 +1,21 @@ +import asyncio +import os +import sys + + +comfy_path = os.path.dirname(os.path.abspath(__file__)) +comfy_path = os.path.join(comfy_path, '..', 'ComfyUI') + +# change to ComfyUI directory +os.chdir(comfy_path) + +# add ComfyUI to path +sys.path.append(comfy_path) + +from server import PromptServer +from execution import PromptQueue + +loop = asyncio.new_event_loop() +asyncio.set_event_loop(loop) +server = PromptServer(loop) +q = PromptQueue(server) \ No newline at end of file diff --git a/image_generation/ComfyLauncher/README.md b/image_generation/ComfyLauncher/README.md new file mode 100644 index 0000000..e69de29 diff --git a/image_generation/ComfyLauncher/prompt.json b/image_generation/ComfyLauncher/prompt.json new file mode 100644 index 0000000..5651f91 --- /dev/null +++ b/image_generation/ComfyLauncher/prompt.json @@ -0,0 +1,86 @@ +{ + "3": { + "class_type": "KSampler", + "inputs": { + "cfg": 8, + "denoise": 1, + "latent_image": [ + "5", + 0 + ], + "model": [ + "4", + 0 + ], + "negative": [ + "7", + 0 + ], + "positive": [ + "6", + 0 + ], + "sampler_name": "euler", + "scheduler": "normal", + "seed": 8566257, + "steps": 20 + } + }, + "4": { + "class_type": "CheckpointLoaderSimple", + "inputs": { + "ckpt_name": "v1-5-pruned-emaonly.ckpt" + } + }, + "5": { + "class_type": "EmptyLatentImage", + "inputs": { + "batch_size": 1, + "height": 512, + "width": 512 + } + }, + "6": { + "class_type": "CLIPTextEncode", + "inputs": { + "clip": [ + "4", + 1 + ], + "text": "masterpiece best quality girl" + } + }, + "7": { + "class_type": "CLIPTextEncode", + "inputs": { + "clip": [ + "4", + 1 + ], + "text": "bad hands" + } + }, + "8": { + "class_type": "VAEDecode", + "inputs": { + "samples": [ + "3", + 0 + ], + "vae": [ + "4", + 2 + ] + } + }, + "9": { + "class_type": "SaveImage", + "inputs": { + "filename_prefix": "ComfyUI", + "images": [ + "8", + 0 + ] + } + } +} \ No newline at end of file diff --git a/image_generation/ComfyLauncher/send_request.py b/image_generation/ComfyLauncher/send_request.py new file mode 100644 index 0000000..e69de29 diff --git a/image_generation/ComfyUI b/image_generation/ComfyUI new file mode 160000 index 0000000..53c8a99 --- /dev/null +++ b/image_generation/ComfyUI @@ -0,0 +1 @@ +Subproject commit 53c8a99e6c00b5e20425100f6680cd9ea2652218