Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,6 +45,7 @@ class Pipeline:
|
|
| 45 |
# 若文件夹已存在,先删除旧文件(可选,根据需求决定)
|
| 46 |
if os.path.exists(self.tmp_dir):
|
| 47 |
shutil.rmtree(self.tmp_dir) # 递归删除文件夹及内容
|
|
|
|
| 48 |
# self.denoiser.compile()
|
| 49 |
|
| 50 |
|
|
@@ -93,7 +94,7 @@ class Pipeline:
|
|
| 93 |
)
|
| 94 |
# 生成唯一文件名(结合seed和样本索引,避免冲突)
|
| 95 |
gif_filename = f"{random.randint(0, 100000)}.gif"
|
| 96 |
-
gif_path = os.path.join(self.tmp_dir
|
| 97 |
frames[0].save(
|
| 98 |
gif_path,
|
| 99 |
format="GIF",
|
|
|
|
| 45 |
# 若文件夹已存在,先删除旧文件(可选,根据需求决定)
|
| 46 |
if os.path.exists(self.tmp_dir):
|
| 47 |
shutil.rmtree(self.tmp_dir) # 递归删除文件夹及内容
|
| 48 |
+
os.makedirs(self.tmp_dir, exist_ok=False)
|
| 49 |
# self.denoiser.compile()
|
| 50 |
|
| 51 |
|
|
|
|
| 94 |
)
|
| 95 |
# 生成唯一文件名(结合seed和样本索引,避免冲突)
|
| 96 |
gif_filename = f"{random.randint(0, 100000)}.gif"
|
| 97 |
+
gif_path = os.path.join(self.tmp_dir, gif_filename)
|
| 98 |
frames[0].save(
|
| 99 |
gif_path,
|
| 100 |
format="GIF",
|