- handler.py +5 -1
handler.py
CHANGED
@@ -38,16 +38,20 @@ class EndpointHandler():
|
|
38 |
denoising_end = data.pop("denoising_end_step", 1)
|
39 |
num_images_per_prompt = data.pop("num_images_per_prompt", 1)
|
40 |
aesthetic_score = data.pop("aesthetic_score", 0.6)
|
41 |
-
|
42 |
|
43 |
# process image
|
44 |
if encoded_image is not None:
|
45 |
image = self.decode_base64_image(encoded_image)
|
|
|
46 |
else:
|
|
|
47 |
image = None
|
|
|
|
|
48 |
|
49 |
print(f"Prompt: {inputs}, strength: {strength}, inf steps: {num_inference_steps}, denoise start: {denoising_start}, denoise_end: {denoising_end}")
|
50 |
print(f"Imgs per prompt: {num_images_per_prompt}, aesthetic_score: {aesthetic_score}, guidance_scale: {guidance_scale}, negative_prompt: {negative_prompt}")
|
|
|
51 |
# run inference pipeline
|
52 |
out = self.pipe(inputs,
|
53 |
image=image,
|
|
|
38 |
denoising_end = data.pop("denoising_end_step", 1)
|
39 |
num_images_per_prompt = data.pop("num_images_per_prompt", 1)
|
40 |
aesthetic_score = data.pop("aesthetic_score", 0.6)
|
|
|
41 |
|
42 |
# process image
|
43 |
if encoded_image is not None:
|
44 |
image = self.decode_base64_image(encoded_image)
|
45 |
+
print("Image is getting loaded")
|
46 |
else:
|
47 |
+
print("Image is None")
|
48 |
image = None
|
49 |
+
|
50 |
+
imgLen = len(image)
|
51 |
|
52 |
print(f"Prompt: {inputs}, strength: {strength}, inf steps: {num_inference_steps}, denoise start: {denoising_start}, denoise_end: {denoising_end}")
|
53 |
print(f"Imgs per prompt: {num_images_per_prompt}, aesthetic_score: {aesthetic_score}, guidance_scale: {guidance_scale}, negative_prompt: {negative_prompt}")
|
54 |
+
print(f"Image size: {imgLen}")
|
55 |
# run inference pipeline
|
56 |
out = self.pipe(inputs,
|
57 |
image=image,
|