Skip to content

Instantly share code, notes, and snippets.

@knot126
Created April 26, 2023 08:05
Show Gist options
  • Save knot126/4e1899d030367eb9b926a82046b7e968 to your computer and use it in GitHub Desktop.
Save knot126/4e1899d030367eb9b926a82046b7e968 to your computer and use it in GitHub Desktop.
import requests
import urllib.parse
MODELS = ["photo", "standard", "cartoon", "light"]
MODES = ["cpu", "gpu"]
infull = urllib.parse.quote(b"C:\\Users\\User\\SomeFile.png")
folder = urllib.parse.quote(b"C:\\Users\\User\\OutputAI\\")
size = urllib.parse.quote(str(64 * 64))
r = requests.post(f"http://localhost:56379/naiu/local/updatedslice/{MODELS[2]}/{MODES[0]}/1/4", data = bytes(f"{infull}\r\n{folder}\r\n{size}", "utf-8"))
print(r.url)
print(r.headers)
print(f"==== RESPONSE ({len(r.text)}) ====")
print(r.text)
print("==== RESPONSE ====")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment