This commit is contained in:
Ruixi Fan 2023-11-21 16:52:21 -08:00
parent 0256e7f769
commit 7f40be7443
No known key found for this signature in database
GPG Key ID: C6112CB66F7DED6C
2 changed files with 26 additions and 23 deletions

View File

@ -107,14 +107,15 @@ def queue_prompt(prompt):
request.urlopen(req) request.urlopen(req)
prompt = json.loads(prompt_text) if __name__ == "__main__":
#set the text prompt for our positive CLIPTextEncode prompt = json.loads(prompt_text)
prompt["6"]["inputs"]["text"] = "masterpiece best quality man" #set the text prompt for our positive CLIPTextEncode
prompt["6"]["inputs"]["text"] = "masterpiece best quality man"
#set the seed for our KSampler node #set the seed for our KSampler node
prompt["3"]["inputs"]["seed"] = 5 prompt["3"]["inputs"]["seed"] = 5
res = queue_prompt(prompt)
queue_prompt(prompt) print(res)

View File

@ -142,23 +142,25 @@ prompt_text = """
} }
""" """
prompt = json.loads(prompt_text)
#set the text prompt for our positive CLIPTextEncode
prompt["6"]["inputs"]["text"] = "masterpiece best quality man"
#set the seed for our KSampler node if __name__ == "__main__":
prompt["3"]["inputs"]["seed"] = 5 prompt = json.loads(prompt_text)
#set the text prompt for our positive CLIPTextEncode
prompt["6"]["inputs"]["text"] = "masterpiece best quality man"
ws = websocket.WebSocket() #set the seed for our KSampler node
ws.connect("ws://{}/ws?clientId={}".format(server_address, client_id)) prompt["3"]["inputs"]["seed"] = 5
images = get_images(ws, prompt)
#Commented out code to display the output images: ws = websocket.WebSocket()
ws.connect("ws://{}/ws?clientId={}".format(server_address, client_id))
images = get_images(ws, prompt)
# for node_id in images: #Commented out code to display the output images:
# for image_data in images[node_id]:
# from PIL import Image for node_id in images:
# import io for image_data in images[node_id]:
# image = Image.open(io.BytesIO(image_data)) from PIL import Image
# image.show() import io
image = Image.open(io.BytesIO(image_data))
image.show()