Spaces:
Running
Running
P01yH3dr0n
commited on
Commit
•
84236ad
1
Parent(s):
522de11
rename generated img
Browse files
app.py
CHANGED
@@ -124,6 +124,8 @@ def rename_save_img(path, payload, save):
|
|
124 |
default = os.path.basename(path)
|
125 |
filename = str(today_count).rjust(5, '0') + '-' + str(payload['parameters']['seed']) + '.png'
|
126 |
renamed_path = path.replace(default, filename)
|
|
|
|
|
127 |
os.replace(path, renamed_path)
|
128 |
if save:
|
129 |
save_path = client_config['save_path']
|
|
|
124 |
default = os.path.basename(path)
|
125 |
filename = str(today_count).rjust(5, '0') + '-' + str(payload['parameters']['seed']) + '.png'
|
126 |
renamed_path = path.replace(default, filename)
|
127 |
+
if os.path.exists(renamed_path):
|
128 |
+
return renamed_path
|
129 |
os.replace(path, renamed_path)
|
130 |
if save:
|
131 |
save_path = client_config['save_path']
|