Skip to content

Commit d691c62

Browse files
committed
server: small test client fixes
1 parent 59ba76c commit d691c62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/server/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def show_img(img: Image, title = None) -> None:
3939
info = PngImagePlugin.PngInfo()
4040
for key, value in img.info.items():
4141
info.add_text(key, value)
42-
tmp = img._dump(title, format=img.format, pnginfo=info)
42+
tmp = img._dump(None, format=img.format, pnginfo=info)
4343
print(f"Image path: {tmp}\n")
4444
for viewer in ImageShow._viewers:
4545
if viewer.show_file(tmp,title=title):
@@ -133,8 +133,8 @@ def showImages(imgs: List[Image.Image]) -> None:
133133
for (i,img) in enumerate(imgs):
134134
if os.name == 'nt':
135135
t = Thread(target=show_img, args=(img, f"IMG {i}"))
136-
t.setDaemon(True)
137-
t.start
136+
t.daemon = True
137+
t.start()
138138
else:
139139
show_img(img, f"IMG {i}")
140140

@@ -162,7 +162,7 @@ def saveImages(imgs: List[Image.Image], path: str) -> None:
162162

163163
def _print_usage():
164164
print("""Example usage (images will be displayed and saved to a temporary file):
165-
update_url(server=127.0.0.1, port=8080)
165+
update_url(server="127.0.0.1", port=8080)
166166
showImages(getImages(sendRequest(json.dumps({'seed': -1, 'batch_count':4, 'sample_steps':24, 'width': 512, 'height':768, 'negative_prompt': "Bad quality", 'prompt': "A beautiful image"}))))""")
167167

168168
if __name__ == "__main__":

0 commit comments

Comments
 (0)