phamngoctukts commited on
Commit
0f9fd16
1 Parent(s): e6925fa

Update render.py

Browse files
Files changed (1) hide show
  1. render.py +5 -1
render.py CHANGED
@@ -77,7 +77,11 @@ def generate_images(positive_prompt, image):
77
  ws.connect(ws_url)
78
  data = json.loads(json_data)
79
  data["49"]["inputs"]["text"] = positive_prompt
80
- data["90"]["inputs"]["images"]["base64"] = [pil_to_base64(image)]
 
 
 
 
81
  seed = random.randint(1, 1000000000)
82
  data["47"]["inputs"]["noise_seed"] = seed
83
  images = get_images(ws, data)
 
77
  ws.connect(ws_url)
78
  data = json.loads(json_data)
79
  data["49"]["inputs"]["text"] = positive_prompt
80
+ if image:
81
+ data["90"]["inputs"]["images"]["base64"] = [pil_to_base64(image)]
82
+ else:
83
+ data.pop("90", None)
84
+ data["68"]["enabled"] = False
85
  seed = random.randint(1, 1000000000)
86
  data["47"]["inputs"]["noise_seed"] = seed
87
  images = get_images(ws, data)