Spaces:
Running
Running
Upload 4 files
Browse files- README.md +2 -2
- app.py +1 -1
- convert_url_to_diffusers_sdxl_gr.py +3 -3
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: indigo
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
|
|
1 |
---
|
2 |
+
title: SD-XL To Diffusers V2
|
3 |
+
emoji: 🎨➡️🧨
|
4 |
colorFrom: indigo
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
app.py
CHANGED
@@ -35,7 +35,7 @@ with gr.Blocks(theme="NoCrypt/miku@>=1.2.2", css=css) as demo:
|
|
35 |
**⚠️IMPORTANT NOTICE⚠️**<br>
|
36 |
From an information security standpoint, it is dangerous to expose your access token or key to others.
|
37 |
If you do use it, I recommend that you duplicate this space on your own account before doing so.
|
38 |
-
Keys and tokens
|
39 |
It saves you the trouble of typing them in.<br>
|
40 |
<br>
|
41 |
**The steps are the following**:
|
|
|
35 |
**⚠️IMPORTANT NOTICE⚠️**<br>
|
36 |
From an information security standpoint, it is dangerous to expose your access token or key to others.
|
37 |
If you do use it, I recommend that you duplicate this space on your own account before doing so.
|
38 |
+
Keys and tokens could be set to SECRET (HF_TOKEN, CIVITAI_API_KEY) if it's placed in your own space.
|
39 |
It saves you the trouble of typing them in.<br>
|
40 |
<br>
|
41 |
**The steps are the following**:
|
convert_url_to_diffusers_sdxl_gr.py
CHANGED
@@ -16,7 +16,7 @@ def is_repo_name(s):
|
|
16 |
return re.fullmatch(r'^[^/\.,\s]+?/[^/\.,\s]+?$', s)
|
17 |
|
18 |
|
19 |
-
def download_thing(directory, url, civitai_api_key=""):
|
20 |
url = url.strip()
|
21 |
if "drive.google.com" in url:
|
22 |
original_dir = os.getcwd()
|
@@ -52,7 +52,7 @@ def get_local_model_list(dir_path):
|
|
52 |
return model_list
|
53 |
|
54 |
|
55 |
-
def get_download_file(temp_dir, url, civitai_key):
|
56 |
if not "http" in url and is_repo_name(url) and not Path(url).exists():
|
57 |
print(f"Use HF Repo: {url}")
|
58 |
new_file = url
|
@@ -311,7 +311,7 @@ def convert_url_to_diffusers_repo(dl_url, new_repo_id, hf_token, civitai_key="",
|
|
311 |
repo_urls.append(repo_url)
|
312 |
md = "Your new repo:<br>"
|
313 |
for u in repo_urls:
|
314 |
-
md += f"[{str(u).split('/')[-2]}{str(u).split('/')[-1]}]({str(u)})<br>"
|
315 |
return gr.update(value=repo_urls, choices=repo_urls), gr.update(value=md)
|
316 |
|
317 |
|
|
|
16 |
return re.fullmatch(r'^[^/\.,\s]+?/[^/\.,\s]+?$', s)
|
17 |
|
18 |
|
19 |
+
def download_thing(directory, url, civitai_api_key="", progress=gr.Progress(track_tqdm=True)):
|
20 |
url = url.strip()
|
21 |
if "drive.google.com" in url:
|
22 |
original_dir = os.getcwd()
|
|
|
52 |
return model_list
|
53 |
|
54 |
|
55 |
+
def get_download_file(temp_dir, url, civitai_key, progress=gr.Progress(track_tqdm=True)):
|
56 |
if not "http" in url and is_repo_name(url) and not Path(url).exists():
|
57 |
print(f"Use HF Repo: {url}")
|
58 |
new_file = url
|
|
|
311 |
repo_urls.append(repo_url)
|
312 |
md = "Your new repo:<br>"
|
313 |
for u in repo_urls:
|
314 |
+
md += f"[{str(u).split('/')[-2]}/{str(u).split('/')[-1]}]({str(u)})<br>"
|
315 |
return gr.update(value=repo_urls, choices=repo_urls), gr.update(value=md)
|
316 |
|
317 |
|