Spaces:
Running
on
Zero
Running
on
Zero
tori29umai
commited on
Commit
•
0c98b49
1
Parent(s):
d8b577b
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
-
from diffusers import ControlNetModel, StableDiffusionXLControlNetImg2ImgPipeline, AutoencoderKL
|
5 |
-
|
6 |
from PIL import Image
|
7 |
import os
|
8 |
import time
|
@@ -15,32 +14,6 @@ import pygit2
|
|
15 |
import shutil
|
16 |
import os
|
17 |
|
18 |
-
# クローンするリポジトリのURLと保存先のパス
|
19 |
-
repo_url = "https://github.com/jabir-zheng/TCD.git"
|
20 |
-
repo_dir = "TCD"
|
21 |
-
|
22 |
-
# Git リポジトリをクローン
|
23 |
-
repo = pygit2.clone_repository(repo_url, repo_dir)
|
24 |
-
|
25 |
-
# 現在の作業ディレクトリを取得
|
26 |
-
current_dir = os.getcwd()
|
27 |
-
|
28 |
-
# Git関連のファイル(.git)を無視するための関数
|
29 |
-
def ignore_git_files(path, names):
|
30 |
-
return [name for name in names if name == '.git']
|
31 |
-
|
32 |
-
# コピー先のディレクトリが存在する場合、削除する
|
33 |
-
if os.path.exists(current_dir):
|
34 |
-
shutil.rmtree(current_dir)
|
35 |
-
|
36 |
-
# クローンしたリポジトリの内容を現在のディレクトリにコピー
|
37 |
-
shutil.copytree(repo_dir, current_dir, ignore=ignore_git_files)
|
38 |
-
|
39 |
-
# コピーが完了したことを表示
|
40 |
-
print(f"Repository contents (excluding .git) have been copied to {current_dir}")
|
41 |
-
|
42 |
-
from scheduling_tcd import TCDScheduler
|
43 |
-
|
44 |
path = os.getcwd()
|
45 |
cn_dir = f"{path}/controlnet"
|
46 |
tagger_dir = f"{path}/tagger"
|
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
+
from diffusers import ControlNetModel, StableDiffusionXLControlNetImg2ImgPipeline, AutoencoderKL, TCDScheduler
|
|
|
5 |
from PIL import Image
|
6 |
import os
|
7 |
import time
|
|
|
14 |
import shutil
|
15 |
import os
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
path = os.getcwd()
|
18 |
cn_dir = f"{path}/controlnet"
|
19 |
tagger_dir = f"{path}/tagger"
|