Skip to content

Commit

Permalink
asdfa
Browse files Browse the repository at this point in the history
  • Loading branch information
WillReynolds5 committed Sep 16, 2024
1 parent 0e2510f commit 2a43fd2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
11 changes: 11 additions & 0 deletions comfyui.log
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,14 @@ Prestartup times for custom nodes:
[2024-09-15 21:11] Redraw enabled: True
[2024-09-15 21:11] Seams fix mode: NONE
[2024-09-15 21:11] 100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.39it/s]100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.43it/s]
[2024-09-15 21:11] 100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.35it/s]100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.39it/s]
[2024-09-15 21:11] 100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.30it/s]100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.31it/s]
[2024-09-15 21:12] 100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.36it/s]100%|████████████████████████████████████████████████████████████████| 5/5 [00:03<00:00, 1.39it/s]
[2024-09-15 21:12]
[2024-09-15 21:12]
[2024-09-15 21:12] 0: 640x512 1 face, 12.9ms
[2024-09-15 21:12] 0: 640x512 1 face, 12.9ms
[2024-09-15 21:12] Speed: 2.5ms preprocess, 12.9ms inference, 1.3ms postprocess per image at shape (1, 3, 640, 512)
[2024-09-15 21:12] Speed: 2.5ms preprocess, 12.9ms inference, 1.3ms postprocess per image at shape (1, 3, 640, 512)
[2024-09-15 21:12] Detailer: segment upscale for ((235.40738, 310.93002)) | crop region (706, 932) x 1.0989236521631611 -> (775, 1024)
[2024-09-15 21:12] 100%|████████████████████████████████████████████████████████████████| 5/5 [00:04<00:00, 1.10s/it]100%|████████████████████████████████████████████████████████████████| 5/5 [00:04<00:00, 1.04it/s]
Expand Down
36 changes: 35 additions & 1 deletion meeca/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import streamlit as st
from meeca.scratch_3 import gen_prompt
import random
import tempfile
import requests
import json
Expand All @@ -9,6 +9,40 @@
# Set the server address for your API
server_address = "http://127.0.0.1:8188"


def gen_prompt(pos_prompt, neg_prompt, background_prompt, face_image, pose_image, seed=None):
if seed is None:
seed = random.randint(0, 1_000_000)

# Load the character generation JSON file
with open('meeca/charactergen.json', 'r') as file:
character_gen_data = json.load(file)

# Modify the positive, negative, and background prompts
character_gen_data["17"]["inputs"]["text"] = pos_prompt
character_gen_data["18"]["inputs"]["text"] = neg_prompt
character_gen_data["86"]["inputs"]["text"] = background_prompt # Added background prompt

# Set the seed
character_gen_data["19"]["inputs"]["seed"] = seed

# Set the grounding dino prompt to 'women'
character_gen_data["14"]["inputs"]["prompt"] = "women"

# Set the image paths for face and pose images
character_gen_data["11"]["inputs"]["image"] = pose_image
character_gen_data["29"]["inputs"]["image"] = face_image

return character_gen_data

def queue_prompt(prompt):
payload = {"prompt": prompt}
data = json.dumps(payload)
headers = {'Content-Type': 'application/json'}
response = requests.post("http://174.52.227.249:8188/prompt", data=data, headers=headers)
print(response.text)


def queue_prompt(prompt):
payload = {"prompt": prompt}
response = requests.post(f"{server_address}/prompt", json=payload)
Expand Down

0 comments on commit 2a43fd2

Please sign in to comment.