| | |
| | """comfyui_drive_link.ipynb |
| | |
| | Automatically generated by Colab. |
| | |
| | Original file is located at |
| | https://colab.research.google.com/#fileId=https%3A//huggingface.co/arcacolab/drive_link/blob/main/comfyui_drive_link.ipynb |
| | |
| | <a href="https://colab.research.google.com/github/arcacolab/oneclick/blob/main/comfyui_drive_link.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
| | """ |
| |
|
| | import os |
| | source_checkpoints = "/content/ComfyUI/models/checkpoints" |
| | target_checkpoints = "/content/drive/MyDrive/ONECLICK/model" |
| | source_loras = "/content/ComfyUI/models/loras" |
| | target_loras = "/content/drive/MyDrive/ONECLICK/lora" |
| | source_vae = "/content/ComfyUI/models/vae" |
| | target_vae = "/content/drive/MyDrive/ONECLICK/vae" |
| | source_embeddings = "/content/ComfyUI/models/embeddings" |
| | target_embeddings = "/content/drive/MyDrive/ONECLICK/embedding" |
| |
|
| | os.makedirs(target_checkpoints, exist_ok=True) |
| | os.makedirs(target_loras, exist_ok=True) |
| | os.makedirs(target_vae, exist_ok=True) |
| | os.makedirs(target_embeddings, exist_ok=True) |
| |
|
| | !ln -sf "{target_checkpoints}" "{source_checkpoints}" |
| | !ln -sf "{target_loras}" "{source_loras}" |
| | !ln -sf "{target_vae}" "{source_vae}" |
| | !ln -sf "{target_embeddings}" "{source_embeddings}" |
| |
|
| | |
| | import shutil |
| |
|
| | def delete_output_folder_if_file_exists(): |
| | """ |
| | /content/ComfyUI/output ํด๋ ๋ด๋ถ์ _output_images_will_be_put_here ํ์ผ์ด ์๋ ๊ฒฝ์ฐ ํด๋๋ฅผ ์ญ์ ํฉ๋๋ค. |
| | ํ์ผ์ด ์๋ ๊ฒฝ์ฐ ํด๋๋ฅผ ์ ์งํฉ๋๋ค. |
| | """ |
| | folder_path = "/content/ComfyUI/output" |
| | file_path = os.path.join(folder_path, "_output_images_will_be_put_here") |
| |
|
| | if os.path.exists(file_path): |
| | shutil.rmtree(folder_path, ignore_errors=True) |
| | print(f"{folder_path} ํด๋๋ฅผ ์ญ์ ํ์ต๋๋ค. (_output_images_will_be_put_here ํ์ผ์ด ์กด์ฌํฉ๋๋ค.)") |
| | else: |
| | print(f"{folder_path} ํด๋๋ฅผ ์ ์งํฉ๋๋ค. (_output_images_will_be_put_here ํ์ผ์ด ์กด์ฌํ์ง ์์ต๋๋ค.)") |
| |
|
| | |
| | delete_output_folder_if_file_exists() |
| |
|
| |
|
| | import os |
| | sdpath = "/content/drive/MyDrive/ONECLICK/" |
| |
|
| | outputspath = sdpath + "output" |
| |
|
| |
|
| | if not os.path.exists(outputspath): |
| | !mkdir -p -v "{outputspath}" |
| |
|
| | link_path = "/content/ComfyUI/output" |
| | if not os.path.exists(link_path) and not os.path.islink(link_path): |
| | !ln -s -v "{outputspath}" "{link_path}" |