Skip to content

Commit

Permalink
chore: remove unused "get_image" as we just need the actual image, no…
Browse files Browse the repository at this point in the history
…t it's data
  • Loading branch information
TimPietrusky committed Oct 11, 2023
1 parent a1f9488 commit c12790d
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/rp_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,6 @@ def get_history(prompt_id):
with urllib.request.urlopen(f"http://{COMFY_HOST}/history/{prompt_id}") as response:
return json.loads(response.read())

# TODO: Remove if not needed
def get_image(filename, subfolder, folder_type):
"""
Retrieve an image generated by ComfyUI.
Args:
filename (str): The filename of the generated image.
subfolder (str): The subfolder where the image is stored.
folder_type (str): The type of folder where the image is stored.
Returns:
bytes: The image data.
"""
data = {"filename": filename, "subfolder": subfolder, "type": folder_type}
url_values = urllib.parse.urlencode(data)
with urllib.request.urlopen(f"http://{COMFY_HOST}/view?{url_values}") as response:
return response.read()

def handler(job):
"""
The main function that handles a job of generating an image.
Expand Down Expand Up @@ -171,9 +153,6 @@ def handler(job):
images_output = []
for image in node_output['images']:
output_images = image['filename']
# output_images[node_id] = image['filename']
# image_data = get_image(image['filename'], image['subfolder'], image['type'])
# images_output.append(image_data)

print(f'runpod-worker-comfy - image generation is done')

Expand Down

0 comments on commit c12790d

Please sign in to comment.