Commit
·
bdd2c52
1
Parent(s):
ecc11a9
Update app.py
Browse files
app.py
CHANGED
@@ -51,11 +51,11 @@ def query(prompt, is_negative=False, image_style="None style", steps=8, cfg_scal
|
|
51 |
|
52 |
image_bytes = requests.post(API_URL, headers=headers, json=payload).content
|
53 |
image = Image.open(io.BytesIO(image_bytes))
|
54 |
-
|
55 |
api = HfApi()
|
56 |
api.upload_file(
|
57 |
path_or_fileobj=image,
|
58 |
-
path_in_repo="images/img_
|
59 |
repo_id="openskyml/prompts",
|
60 |
repo_type="dataset",
|
61 |
)
|
|
|
51 |
|
52 |
image_bytes = requests.post(API_URL, headers=headers, json=payload).content
|
53 |
image = Image.open(io.BytesIO(image_bytes))
|
54 |
+
rand_num = random.randint(1, 2147483647)
|
55 |
api = HfApi()
|
56 |
api.upload_file(
|
57 |
path_or_fileobj=image,
|
58 |
+
path_in_repo=f"images/img_{rand_num}.png",
|
59 |
repo_id="openskyml/prompts",
|
60 |
repo_type="dataset",
|
61 |
)
|