-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get Output Images (without s3) #5
Comments
Yeah s3 bucket setup is insane, I think a plain b64 image would be alot more "comf"-ortable |
@Dekita yeah, I also think that a base64-encoded image (as suggested by @Satttoshi) would be the way to go to not force someone to setup an S3 bucket. Would that work for you? |
b64 would be perfect. I had tried to implement that change myself last night, but for some reason when i pull the image from my private repo on runpod, i just get bash error when its trying to boot lol. b64 should be super easy to get with something like this anyway:
|
confirmed adding the following code into rp_handler.py works: # at top of file:
import base64
def base64_encode(img_path):
"""
Returns base64 encoded image.
"""
with open(img_path, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read())
return encoded_string.decode("utf-8")
# in handler(job) function: (in place of return value if os.path.exists()
print("runpod-worker-comfy - the image exists in the output folder")
print("runpod-worker-comfy - preparing base64 encoded output")
image_url = rp_upload.upload_image(
job["id"], f"{COMFY_OUTPUT_PATH}/{output_images}"
)
return_base64 = "simulated_uploaded/" in image_url
return_output = f"{image_url}" if not return_base64 else base64_encode(f"{COMFY_OUTPUT_PATH}/{output_images}")
return {
"status": "success",
"message": return_output,
} if you want i can make a pr with the changes :) |
@Dekita this looks really clean, please provide the PR! Thank you very much <3 |
Thanks to @Dekita we have base64 output now. The changes are in dev We should mention, that if you don't configure the S3 env variables, then the output will be base64. I will update the docs once the dev-image is actually fine and create a new release. |
base64 was added with https://github.com/blib-la/runpod-worker-comfy/releases/tag/1.1.0 |
is it possible to obtain the output images without using an s3 bucket? if so, how? :)
I see they are being stored at '"simulated_uploaded/xyz.png", but thats relative to the serverless container right? so how can this be accessed when the job completes?
The text was updated successfully, but these errors were encountered: