Spaces:
Running
on
Zero
Running
on
Zero
tori29umai
commited on
Commit
•
f98bb34
1
Parent(s):
75efe48
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ 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
|
@@ -11,6 +11,32 @@ from utils.image_utils import resize_image_aspect_ratio, base_generation, backgr
|
|
11 |
from utils.prompt_utils import execute_prompt, remove_color, remove_duplicates
|
12 |
from utils.tagger import modelLoad, analysis
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
path = os.getcwd()
|
15 |
cn_dir = f"{path}/controlnet"
|
16 |
tagger_dir = f"{path}/tagger"
|
|
|
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
|
|
|
11 |
from utils.prompt_utils import execute_prompt, remove_color, remove_duplicates
|
12 |
from utils.tagger import modelLoad, analysis
|
13 |
|
14 |
+
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 |
+
shutil.copytree(repo_dir, current_dir, ignore=ignore_git_files)
|
34 |
+
|
35 |
+
# コピーが完了したことを表示
|
36 |
+
print(f"Repository contents (excluding .git) have been copied to {current_dir}")
|
37 |
+
|
38 |
+
from scheduling_tcd import TCDScheduler
|
39 |
+
|
40 |
path = os.getcwd()
|
41 |
cn_dir = f"{path}/controlnet"
|
42 |
tagger_dir = f"{path}/tagger"
|