{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"private_outputs": true,
"provenance": [],
"gpuType": "T4"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "code",
"source": [
"#############################################################################\n",
"#@markdown ### **ComfyUI 설치 및 실행**\n",
"USE_GDRIVE = True # @param {\"type\":\"boolean\"}\n",
"#############################################################################\n",
"import os\n",
"import subprocess\n",
"\n",
"def install_packages():\n",
" print(\"📥 필수 패키지 설치중.. \", end=\"\", flush=True)\n",
"\n",
" commands = [\n",
" \"apt-get install lz4 -y -qq\",\n",
" \"command -v aria2c >/dev/null || (apt update -qq && apt install -qq aria2 -y)\",\n",
" \"pip show huggingface_hub >/dev/null || pip install -q huggingface_hub\",\n",
" \"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",
" ]\n",
"\n",
" for cmd in commands:\n",
" subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\n",
"\n",
" print(\"✨ 완료\")\n",
"\n",
"install_packages()\n",
"#############################################################################\n",
"if USE_GDRIVE:\n",
" from google.colab import drive\n",
" drive.mount('/content/drive')\n",
"\n",
"if not os.path.exists(\"/content/ComfyUI\"):\n",
" !wget -q -nc -P py/ https://huggingface.co/arcacolab/data/resolve/main/newmain_2.py\n",
" !git clone https://github.com/comfyanonymous/ComfyUI\n",
" #커스텀녿\n",
" %cd /content/ComfyUI/custom_nodes\n",
" !git clone https://github.com/ltdrdata/ComfyUI-Manager comfyui-manager\n",
" !git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git\n",
" !git clone https://github.com/bedovyy/chibi-client\n",
" !git clone https://github.com/cosmicbuffalo/comfyui-mobile-frontend.git\n",
" !git clone https://github.com/rgthree/rgthree-comfy.git\n",
" #!git clone https://github.com/ruwwww/comfyui-spectrum-sdxl\n",
" !git clone https://github.com/kijai/ComfyUI-KJNodes.git\n",
" !git clone https://github.com/BobJohnson24/ComfyUI-INT8-Fast.git\n",
"\n",
" #!git clone https://github.com/ssitu/ComfyUI_UltimateSDUpscale --recursive\n",
" !pip install -r /content/ComfyUI/requirements.txt\n",
"\n",
" #기본 워크플로우 다운로드\n",
" !wget -q -nc -P /content/ComfyUI/user/default/workflows/ https://huggingface.co/arcacolab/data/resolve/main/anima_basic.json\n",
" !wget -q -nc -P /content/ComfyUI/user/default/workflows/ https://huggingface.co/arcacolab/data/resolve/main/anima_fast_sage_torch_cach.json\n",
"\n",
" #sage, triton 설치\n",
" !pip install triton==3.2.0 sageattention\n",
"\n",
"#############################################################################\n",
"\n",
"if USE_GDRIVE:\n",
" source_loras = \"/content/ComfyUI/models/loras\"\n",
" target_loras = \"/content/drive/MyDrive/ONECLICK/lora\"\n",
"\n",
" os.makedirs(target_loras, exist_ok=True)\n",
"\n",
" !ln -sf \"{target_loras}\" \"{source_loras}\"\n",
"\n",
" #출력물 경로 관련\n",
" import shutil\n",
"\n",
" def delete_output_folder_if_file_exists():\n",
" folder_path = \"/content/ComfyUI/output\"\n",
" file_path = os.path.join(folder_path, \"_output_images_will_be_put_here\")\n",
"\n",
" if os.path.exists(file_path):\n",
" shutil.rmtree(folder_path, ignore_errors=True)\n",
" #print(f\"{folder_path} 폴더를 삭제했습니다. (_output_images_will_be_put_here 파일이 존재합니다.)\")\n",
" else:\n",
" #print(f\"{folder_path} 폴더를 유지합니다. (_output_images_will_be_put_here 파일이 존재하지 않습니다.)\")\n",
" print(\"✨ 드라이브 연동 완료.\")\n",
" # 함수 호출\n",
" delete_output_folder_if_file_exists()\n",
"\n",
" sdpath = \"/content/drive/MyDrive/ONECLICK/\"\n",
" outputspath = sdpath + \"outputs/ComfyUI\"\n",
"\n",
" if not os.path.exists(outputspath):\n",
" !mkdir -p -v \"{outputspath}\"\n",
"\n",
" link_path = \"/content/ComfyUI/output\"\n",
" if not os.path.exists(link_path) and not os.path.islink(link_path):\n",
" !ln -s -v \"{outputspath}\" \"{link_path}\"\n",
"\n",
"#############################################################################\n",
"\n",
"# 디퓨전모델 다운로드\n",
"print(\"🚀 anima-preview3-base-int8rowwise 다운로드... \")\n",
"%cd /content/ComfyUI/models/diffusion_models\n",
"!aria2c --continue=true --console-log-level=error -x 16 -s 16 \\\n",
"-o anima-preview3-base-int8rowwise.safetensors \\\n",
"\"https://huggingface.co/Bedovyy/Anima-INT8/resolve/main/anima-preview3-base-int8rowwise.safetensors\"\n",
"\n",
"# Text Encoders 다운로드\n",
"print(\"🚀 qwen_3_06b_base 다운로드... \")\n",
"%cd /content/ComfyUI/models/text_encoders\n",
"!aria2c --continue=true --console-log-level=error -x 16 -s 16 \\\n",
"-o qwen_3_06b_base.safetensors \\\n",
"\"https://huggingface.co/circlestone-labs/Anima/resolve/main/split_files/text_encoders/qwen_3_06b_base.safetensors\"\n",
"\n",
"# VAE 다운로드\n",
"print(\"🚀 qwen_image_vae 다운로드... \")\n",
"%cd /content/ComfyUI/models/vae\n",
"!aria2c --continue=true --console-log-level=error -x 16 -s 16 \\\n",
"-o qwen_image_vae.safetensors \\\n",
"\"https://huggingface.co/circlestone-labs/Anima/resolve/main/split_files/vae/qwen_image_vae.safetensors\"\n",
"\n",
"print(\"✨ 모든 다운로드&설치 완료됨.\")\n",
"\n",
"%cd /content\n",
"!python py/newmain_2.py --dont-print-server --preview-method auto --disable-api-nodes --fast fp16_accumulation cublas_ops --disable-dynamic-vram\n",
"#if WORKSPACE == \"DRIVE\":\n",
"#!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"
],
"metadata": {
"cellView": "form",
"id": "4CLSeDJ63JDN"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"/content/ComfyUI/models/diffusion_models"
],
"metadata": {
"id": "msil0bGHRJdi"
}
},
{
"cell_type": "code",
"source": [
"/content/ComfyUI"
],
"metadata": {
"id": "qCFHL7U1QG09"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"#@markdown ### **백그라운드 꺼짐 방지(무음 재생)**\n",
"\n",
"%%html\n",
"