jonathanpark commited on
Commit
c79fe71
1 Parent(s): 8dbd200

add parameters

Browse files
Files changed (1) hide show
  1. handler.py +5 -1
handler.py CHANGED
@@ -3,12 +3,16 @@ import torch
3
  from PIL import Image
4
  from io import BytesIO
5
  from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, DDIMScheduler
 
6
 
7
  import base64
8
  import requests
9
  from io import BytesIO
10
  from PIL import Image
11
 
 
 
 
12
  def load_image(image_url):
13
  if image_url.startswith('data:'):
14
  # Decode base64 data_uri
@@ -65,7 +69,7 @@ class EndpointHandler():
65
  strength = params.pop("height", 0.8)
66
  width = params.pop("width", None)
67
  manual_seed = params.pop("manual_seed", -1)
68
-
69
  out = None
70
 
71
  generator = torch.Generator(device='cuda')
 
3
  from PIL import Image
4
  from io import BytesIO
5
  from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, DDIMScheduler
6
+ from transformers.utils import logging
7
 
8
  import base64
9
  import requests
10
  from io import BytesIO
11
  from PIL import Image
12
 
13
+ logging.set_verbosity_info()
14
+ logger = logging.get_logger("transformers")
15
+
16
  def load_image(image_url):
17
  if image_url.startswith('data:'):
18
  # Decode base64 data_uri
 
69
  strength = params.pop("height", 0.8)
70
  width = params.pop("width", None)
71
  manual_seed = params.pop("manual_seed", -1)
72
+ logger.info(f"parameters: {strength}, {height}, {width}, {manual_seed}")
73
  out = None
74
 
75
  generator = torch.Generator(device='cuda')