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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"nbformat": 4,
|
| 3 |
+
"nbformat_minor": 0,
|
| 4 |
+
"metadata": {
|
| 5 |
+
"colab": {
|
| 6 |
+
"private_outputs": true,
|
| 7 |
+
"provenance": [],
|
| 8 |
+
"gpuType": "T4"
|
| 9 |
+
},
|
| 10 |
+
"kernelspec": {
|
| 11 |
+
"name": "python3",
|
| 12 |
+
"display_name": "Python 3"
|
| 13 |
+
},
|
| 14 |
+
"language_info": {
|
| 15 |
+
"name": "python"
|
| 16 |
+
},
|
| 17 |
+
"accelerator": "GPU"
|
| 18 |
+
},
|
| 19 |
+
"cells": [
|
| 20 |
+
{
|
| 21 |
+
"cell_type": "code",
|
| 22 |
+
"source": [
|
| 23 |
+
"#############################################################################\n",
|
| 24 |
+
"#@markdown ### <font color=\"yellow\">**ComfyUI 설치 및 실행**</font>\n",
|
| 25 |
+
"USE_GDRIVE = True # @param {\"type\":\"boolean\"}\n",
|
| 26 |
+
"#############################################################################\n",
|
| 27 |
+
"import os\n",
|
| 28 |
+
"import subprocess\n",
|
| 29 |
+
"\n",
|
| 30 |
+
"def install_packages():\n",
|
| 31 |
+
" print(\"📥 필수 패키지 설치중.. \", end=\"\", flush=True)\n",
|
| 32 |
+
"\n",
|
| 33 |
+
" commands = [\n",
|
| 34 |
+
" \"apt-get install lz4 -y -qq\",\n",
|
| 35 |
+
" \"command -v aria2c >/dev/null || (apt update -qq && apt install -qq aria2 -y)\",\n",
|
| 36 |
+
" \"pip show huggingface_hub >/dev/null || pip install -q huggingface_hub\",\n",
|
| 37 |
+
" \"command -v cloudflared >/dev/null || (wget -q -P ~ https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && dpkg -i ~/cloudflared-linux-amd64.deb)\"\n",
|
| 38 |
+
" ]\n",
|
| 39 |
+
"\n",
|
| 40 |
+
" for cmd in commands:\n",
|
| 41 |
+
" subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\n",
|
| 42 |
+
"\n",
|
| 43 |
+
" print(\"✨ 완료\")\n",
|
| 44 |
+
"\n",
|
| 45 |
+
"install_packages()\n",
|
| 46 |
+
"#############################################################################\n",
|
| 47 |
+
"if USE_GDRIVE:\n",
|
| 48 |
+
" from google.colab import drive\n",
|
| 49 |
+
" drive.mount('/content/drive')\n",
|
| 50 |
+
"\n",
|
| 51 |
+
"if not os.path.exists(\"/content/ComfyUI\"):\n",
|
| 52 |
+
" !wget -q -nc -P py/ https://huggingface.co/arcacolab/data/resolve/main/newmain_2.py\n",
|
| 53 |
+
" !git clone https://github.com/comfyanonymous/ComfyUI\n",
|
| 54 |
+
" #커스텀녿\n",
|
| 55 |
+
" %cd /content/ComfyUI/custom_nodes\n",
|
| 56 |
+
" !git clone https://github.com/ltdrdata/ComfyUI-Manager comfyui-manager\n",
|
| 57 |
+
" !git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git\n",
|
| 58 |
+
" !git clone https://github.com/bedovyy/chibi-client\n",
|
| 59 |
+
" !git clone https://github.com/cosmicbuffalo/comfyui-mobile-frontend.git\n",
|
| 60 |
+
" !git clone https://github.com/rgthree/rgthree-comfy.git\n",
|
| 61 |
+
" #!git clone https://github.com/ruwwww/comfyui-spectrum-sdxl\n",
|
| 62 |
+
" !git clone https://github.com/kijai/ComfyUI-KJNodes.git\n",
|
| 63 |
+
" !git clone https://github.com/BobJohnson24/ComfyUI-INT8-Fast.git\n",
|
| 64 |
+
"\n",
|
| 65 |
+
" #!git clone https://github.com/ssitu/ComfyUI_UltimateSDUpscale --recursive\n",
|
| 66 |
+
" !pip install -r /content/ComfyUI/requirements.txt\n",
|
| 67 |
+
"\n",
|
| 68 |
+
" #기본 워크플로우 다운로드\n",
|
| 69 |
+
" !wget -q -nc -P /content/ComfyUI/user/default/workflows/ https://huggingface.co/arcacolab/data/resolve/main/anima_basic.json\n",
|
| 70 |
+
" !wget -q -nc -P /content/ComfyUI/user/default/workflows/ https://huggingface.co/arcacolab/data/resolve/main/anima_fast_sage_torch_cach.json\n",
|
| 71 |
+
"\n",
|
| 72 |
+
" #sage, triton 설치\n",
|
| 73 |
+
" !pip install triton==3.2.0 sageattention\n",
|
| 74 |
+
"\n",
|
| 75 |
+
"#############################################################################\n",
|
| 76 |
+
"\n",
|
| 77 |
+
"if USE_GDRIVE:\n",
|
| 78 |
+
" source_loras = \"/content/ComfyUI/models/loras\"\n",
|
| 79 |
+
" target_loras = \"/content/drive/MyDrive/ONECLICK/lora\"\n",
|
| 80 |
+
"\n",
|
| 81 |
+
" os.makedirs(target_loras, exist_ok=True)\n",
|
| 82 |
+
"\n",
|
| 83 |
+
" !ln -sf \"{target_loras}\" \"{source_loras}\"\n",
|
| 84 |
+
"\n",
|
| 85 |
+
" #출력물 경로 관련\n",
|
| 86 |
+
" import shutil\n",
|
| 87 |
+
"\n",
|
| 88 |
+
" def delete_output_folder_if_file_exists():\n",
|
| 89 |
+
" folder_path = \"/content/ComfyUI/output\"\n",
|
| 90 |
+
" file_path = os.path.join(folder_path, \"_output_images_will_be_put_here\")\n",
|
| 91 |
+
"\n",
|
| 92 |
+
" if os.path.exists(file_path):\n",
|
| 93 |
+
" shutil.rmtree(folder_path, ignore_errors=True)\n",
|
| 94 |
+
" #print(f\"{folder_path} 폴더를 삭제했습니다. (_output_images_will_be_put_here 파일이 존재합니다.)\")\n",
|
| 95 |
+
" else:\n",
|
| 96 |
+
" #print(f\"{folder_path} 폴더를 유지합니다. (_output_images_will_be_put_here 파일이 존재하지 않습니다.)\")\n",
|
| 97 |
+
" print(\"✨ 드라이브 연동 완료.\")\n",
|
| 98 |
+
" # 함수 호출\n",
|
| 99 |
+
" delete_output_folder_if_file_exists()\n",
|
| 100 |
+
"\n",
|
| 101 |
+
" sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n",
|
| 102 |
+
" outputspath = sdpath + \"outputs/ComfyUI\"\n",
|
| 103 |
+
"\n",
|
| 104 |
+
" if not os.path.exists(outputspath):\n",
|
| 105 |
+
" !mkdir -p -v \"{outputspath}\"\n",
|
| 106 |
+
"\n",
|
| 107 |
+
" link_path = \"/content/ComfyUI/output\"\n",
|
| 108 |
+
" if not os.path.exists(link_path) and not os.path.islink(link_path):\n",
|
| 109 |
+
" !ln -s -v \"{outputspath}\" \"{link_path}\"\n",
|
| 110 |
+
"\n",
|
| 111 |
+
"#############################################################################\n",
|
| 112 |
+
"\n",
|
| 113 |
+
"# 디퓨전모델 다운로드\n",
|
| 114 |
+
"print(\"🚀 anima-preview3-base-int8rowwise 다운로드... \")\n",
|
| 115 |
+
"%cd /content/ComfyUI/models/diffusion_models\n",
|
| 116 |
+
"!aria2c --continue=true --console-log-level=error -x 16 -s 16 \\\n",
|
| 117 |
+
"-o anima-preview3-base-int8rowwise.safetensors \\\n",
|
| 118 |
+
"\"https://huggingface.co/Bedovyy/Anima-INT8/resolve/main/anima-preview3-base-int8rowwise.safetensors\"\n",
|
| 119 |
+
"\n",
|
| 120 |
+
"# Text Encoders 다운로드\n",
|
| 121 |
+
"print(\"🚀 qwen_3_06b_base 다운로드... \")\n",
|
| 122 |
+
"%cd /content/ComfyUI/models/text_encoders\n",
|
| 123 |
+
"!aria2c --continue=true --console-log-level=error -x 16 -s 16 \\\n",
|
| 124 |
+
"-o qwen_3_06b_base.safetensors \\\n",
|
| 125 |
+
"\"https://huggingface.co/circlestone-labs/Anima/resolve/main/split_files/text_encoders/qwen_3_06b_base.safetensors\"\n",
|
| 126 |
+
"\n",
|
| 127 |
+
"# VAE 다운로드\n",
|
| 128 |
+
"print(\"🚀 qwen_image_vae 다운로드... \")\n",
|
| 129 |
+
"%cd /content/ComfyUI/models/vae\n",
|
| 130 |
+
"!aria2c --continue=true --console-log-level=error -x 16 -s 16 \\\n",
|
| 131 |
+
"-o qwen_image_vae.safetensors \\\n",
|
| 132 |
+
"\"https://huggingface.co/circlestone-labs/Anima/resolve/main/split_files/vae/qwen_image_vae.safetensors\"\n",
|
| 133 |
+
"\n",
|
| 134 |
+
"print(\"✨ 모든 다운로드&설치 완료됨.\")\n",
|
| 135 |
+
"\n",
|
| 136 |
+
"%cd /content\n",
|
| 137 |
+
"!python py/newmain_2.py --dont-print-server --preview-method auto --disable-api-nodes --fast fp16_accumulation cublas_ops --disable-dynamic-vram\n",
|
| 138 |
+
"#if WORKSPACE == \"DRIVE\":\n",
|
| 139 |
+
"#!python py/newmain_gd_2.py --dont-print-server --preview-method auto --fast fp16_accumulation fp8_matrix_mult cublas_ops --use-sage-attention --disable-api-nodes --disable-dynamic-vram"
|
| 140 |
+
],
|
| 141 |
+
"metadata": {
|
| 142 |
+
"cellView": "form",
|
| 143 |
+
"id": "4CLSeDJ63JDN"
|
| 144 |
+
},
|
| 145 |
+
"execution_count": null,
|
| 146 |
+
"outputs": []
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"cell_type": "markdown",
|
| 150 |
+
"source": [
|
| 151 |
+
"/content/ComfyUI/models/diffusion_models"
|
| 152 |
+
],
|
| 153 |
+
"metadata": {
|
| 154 |
+
"id": "msil0bGHRJdi"
|
| 155 |
+
}
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
"cell_type": "code",
|
| 159 |
+
"source": [
|
| 160 |
+
"/content/ComfyUI"
|
| 161 |
+
],
|
| 162 |
+
"metadata": {
|
| 163 |
+
"id": "qCFHL7U1QG09"
|
| 164 |
+
},
|
| 165 |
+
"execution_count": null,
|
| 166 |
+
"outputs": []
|
| 167 |
+
},
|
| 168 |
+
{
|
| 169 |
+
"cell_type": "code",
|
| 170 |
+
"source": [
|
| 171 |
+
"#@markdown ### <font color=\"yellow\">**백그라운드 꺼짐 방지(무음 재생)**</font>\n",
|
| 172 |
+
"\n",
|
| 173 |
+
"%%html\n",
|
| 174 |
+
"<audio autoplay=\"\" src=\"https://raw.githubusercontent.com/KoboldAI/KoboldAI-Client/main/colab/silence.m4a\"; loop controls>"
|
| 175 |
+
],
|
| 176 |
+
"metadata": {
|
| 177 |
+
"cellView": "form",
|
| 178 |
+
"id": "phNLHtAXv5K7"
|
| 179 |
+
},
|
| 180 |
+
"execution_count": null,
|
| 181 |
+
"outputs": []
|
| 182 |
+
}
|
| 183 |
+
]
|
| 184 |
+
}
|