Spaces:
Running
Running
Upload convert_url_to_diffusers_sdxl_gr.py
Browse files
convert_url_to_diffusers_sdxl_gr.py
CHANGED
@@ -233,10 +233,6 @@ def convert_url_to_diffusers_sdxl(url, civitai_key="", is_upload_sf=False, half=
|
|
233 |
pipe = StableDiffusionXLPipeline.from_single_file(new_file, use_safetensors=True, torch_dtype=torch.float16)
|
234 |
else:
|
235 |
pipe = StableDiffusionXLPipeline.from_single_file(new_file, use_safetensors=True)
|
236 |
-
if is_upload_sf:
|
237 |
-
import shutil
|
238 |
-
shutil.move(str(Path(new_file)), str(Path(new_repo_name, Path(new_file).name)))
|
239 |
-
|
240 |
|
241 |
new_vae_file = ""
|
242 |
if vae:
|
@@ -265,6 +261,10 @@ def convert_url_to_diffusers_sdxl(url, civitai_key="", is_upload_sf=False, half=
|
|
265 |
if Path(new_repo_name).exists():
|
266 |
save_readme_md(new_repo_name, url)
|
267 |
|
|
|
|
|
|
|
|
|
268 |
progress(1, desc="Converted.")
|
269 |
return new_repo_name
|
270 |
|
|
|
233 |
pipe = StableDiffusionXLPipeline.from_single_file(new_file, use_safetensors=True, torch_dtype=torch.float16)
|
234 |
else:
|
235 |
pipe = StableDiffusionXLPipeline.from_single_file(new_file, use_safetensors=True)
|
|
|
|
|
|
|
|
|
236 |
|
237 |
new_vae_file = ""
|
238 |
if vae:
|
|
|
261 |
if Path(new_repo_name).exists():
|
262 |
save_readme_md(new_repo_name, url)
|
263 |
|
264 |
+
if not is_repo_name(new_file) and is_upload_sf:
|
265 |
+
import shutil
|
266 |
+
shutil.move(str(Path(new_file).resolve()), str(Path(new_repo_name, Path(new_file).name).resolve()))
|
267 |
+
|
268 |
progress(1, desc="Converted.")
|
269 |
return new_repo_name
|
270 |
|