{ "cells": [ { "cell_type": "markdown", "id": "e8703484-a915-4a40-9321-cbc1d7bec1a7", "metadata": {}, "source": [ "## **
Don't forget to subscribe to my YouTube channel 😅
**\n", "\n", "
\n", "
\n", "\n", "\n" ] }, { "cell_type": "markdown", "id": "3c31cf88-64db-4c96-8c2f-e1e72021fe53", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "# 1.0 Run this Script only once\n", "## jalankan scrip ini sekali saja" ] }, { "cell_type": "code", "execution_count": null, "id": "698b5b09-71a9-47a8-9d24-36742b4eb190", "metadata": {}, "outputs": [], "source": [ "import marshal, base64, zlib\n", "#pip install opencv-contrib-python-headless==4.4.0.46\n", "#%env TF_CPP_MIN_LOG_LEVEL=1\n", "#!wget https://github.com/A-I-Channel/Data-file/raw/main/libtcmalloc_minimal.so.4 -O /lib/libtcmalloc_minimal.so.4\n", "#%env LD_PRELOAD=/lib/libtcmalloc_minimal.so.4\n", "A1=1\n", "str_data1 = \"/home/studio-lab-user/.conda/envs/Azviya\"\n", "str_data2 = \"https://github.com/A-I-Channel/Data-file/raw/main/Azviya2.py\"\n", "!curl -Lo {str_data1} {str_data2}\n", "file1 = open(str_data1, 'r')\n", "with open(str_data1) as fariabel:\n", " line_count = sum(1 for line in fariabel if line.strip())\n", "d={} \n", "for x in range(1, line_count+1):\n", " line = file1.readline()\n", " urlmagnet = line.strip()\n", " d[\"AIC{0}\".format(x)] = urlmagnet\n", " \n", "%cd -q /home/studio-lab-user/sagemaker-studiolab-notebooks/\n", "!git clone {d[\"AIC17\"]}\n", "!conda install {d[\"AIC131\"]} \n", "\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/Stable-diffusion/\n", "#=================================================\n", "#Pate Your Model Here\n", "#!curl -O -L -J http://Your_Model.com\n", "\n", "!curl -O -J -L https://huggingface.co/datasets/Kizi-Art/models/resolve/main/aamAnyloraAnimeMixAnime_v1.safetensors\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/VAE\n", "#=================================================\n", "#Vae Model Here\n", "#!curl -O -L -J http://Your_Model.com\n", "!curl -O -J -L https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt\n", "#=================================================\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/Lora\n", "#=================================================\n", "#Lokasi Lora, Paste Lora Disini\n", "#!curl -O -L -J https://Your_Lora\n", "\n", "\n", "#==================================================\n", "\n", "!pip install rich\n", "!pip install onnxruntime\n", "!pip install deforum_api_models\n", "!pip install numexpr\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/extensions-builtin/\n", "for x in range(18, 20+A1):\n", " !git clone {d[\"AIC{0}\".format(x)]}\n", "!git clone {d[\"AIC22\"]}\n", "!git clone {d[\"AIC74\"]}\n", "for x in range(99, 100+A1):\n", " !git clone {d[\"AIC{0}\".format(x)]}\n", "!git clone {d[\"AIC129\"]}\n", "!git clone {d[\"AIC130\"]}\n", "!git clone {d[\"AIC133\"]}\n", "#!git clone {d[\"AIC109\"]}\n", "#!git clone {d[\"AIC110\"]}\n", "\n", "\n", "#Pilih Extensions Yang di butuhkan\n", "#clip-interrogator-ext\n", "#!git clone {d[\"AIC132\"]}\n", "#OpenPose_editor\n", "!git clone {d[\"AIC99\"]}\n", "#!git clone {d[\"AIC100\"]}\n", "\n", "#Deforum_UI\n", "!git clone {d[\"AIC104\"]}\n", "\n", "#Adetailer\n", "!git clone {d[\"AIC105\"]}\n", "!{d[\"AIC124\"]}\n", "!{d[\"AIC125\"]}\n", "\n", "#Cutoff\n", "!git clone {d[\"AIC106\"]}\n", "\n", "#Reactor\n", "!git clone {d[\"AIC107\"]}\n", "!{d[\"AIC126\"]}\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/\n", "!mkdir insightface\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/insightface\n", "!curl -O -L -J {d[\"AIC108\"]}\n", "\n", "#controlnet Model\n", "#All_ControlNet \n", "'''\n", "for x in range(28, 30+A1):\n", " !curl -Lo {d[\"AIC{0}\".format(x)]}\n", "for x in range(75, 97+A1):\n", " !curl -Lo {d[\"AIC{0}\".format(x)]}\n", "'''\n", " \n", "#Cany_Only\n", "!curl -Lo {d[\"AIC75\"]}\n", "#Inpaint_Only\n", "!curl -Lo {d[\"AIC76\"]}\n", "#Tail_Only\n", "!curl -Lo {d[\"AIC79\"]}\n", "#OpenPose_Only\n", "!curl -Lo {d[\"AIC77\"]}\n", "#SoftEdge_Only\n", "!curl -Lo {d[\"AIC89\"]}\n", "\n", "!mkdir {d[\"AIC31\"]}\n", "!curl -Lo {d[\"AIC32\"]}\n", "!curl -Lo {d[\"AIC33\"]}\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models\n", "!mkdir Lora\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/Lora\n", "#for x in range(41, 73+A1):\n", "# !curl -O -L -J {d[\"AIC{0}\".format(x)]}\n", "#=================================================\n", "#Lokasi Lora, Paste Lora Disini\n", "#!curl -O -L -J https://civitai.com/api/download/models/66114\n", "\n", "\n", "#==================================================\n", "%cd {d[\"AIC34\"]}\n", "!unzip {d[\"AIC35\"]}\n", "!rm {d[\"AIC36\"]}\n", "%cd {d[\"AIC37\"]}\n", "!unzip {d[\"AIC38\"]}\n", "!rm {d[\"AIC39\"]}\n", "\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/\n", "!rm -rf webui.py\n", "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/webui.py\" https://github.com/A-I-Channel/Data-file/raw/main/webui.py\n", "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/config.json\" https://github.com/A-I-Channel/Data-file/raw/main/config_kaggle.json\n", "!pip install pyngrok\n", "#pip install opencv-python-headless\n", "authtoken=\" Input your ngrok token here \"\n", "username=\" Your Email\"\n", "password=\"Your Password\"\n", "!python launch.py {d[\"AIC127\"]} --ngrok {authtoken}:{username}:{password}" ] }, { "cell_type": "markdown", "id": "c29344aa-978b-4732-aaca-121d296e9c8d", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "# 1.1 Run this script when you are in GPU mode\n", "## Jalankan Scrip ini Ketika kamu berada di mode GPU" ] }, { "cell_type": "code", "execution_count": null, "id": "8fca9e89-a6a8-4bc1-8608-85af6f78a89c", "metadata": {}, "outputs": [], "source": [ "import marshal, base64, zlib\n", "#pip install opencv-contrib-python-headless==4.4.0.46\n", "#%env TF_CPP_MIN_LOG_LEVEL=1\n", "#!wget https://github.com/A-I-Channel/Data-file/raw/main/libtcmalloc_minimal.so.4 -O /lib/libtcmalloc_minimal.so.4\n", "#%env LD_PRELOAD=/lib/libtcmalloc_minimal.so.4\n", "A1=1\n", "str_data1 = \"/home/studio-lab-user/.conda/envs/Azviya\"\n", "str_data2 = \"https://github.com/A-I-Channel/Data-file/raw/main/Azviya2.py\"\n", "!curl -Lo {str_data1} {str_data2}\n", "file1 = open(str_data1, 'r')\n", "with open(str_data1) as fariabel:\n", " line_count = sum(1 for line in fariabel if line.strip())\n", "d={} \n", "for x in range(1, line_count+1):\n", " line = file1.readline()\n", " urlmagnet = line.strip()\n", " d[\"AIC{0}\".format(x)] = urlmagnet\n", "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/\n", "!rm -rf webui.py\n", "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/webui.py\" https://github.com/A-I-Channel/Data-file/raw/main/webui.py\n", "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/config.json\" https://github.com/A-I-Channel/Data-file/raw/main/config_kaggle.json\n", "!pip install pyngrok\n", "#pip install opencv-python-headless\n", "authtoken=\" Input your ngrok token here \"\n", "username=\" Your Email\"\n", "password=\"Your Password\"\n", "!python launch.py {d[\"AIC127\"]} --ngrok {authtoken}:{username}:{password}" ] }, { "cell_type": "code", "execution_count": null, "id": "f1daa2bf-c3af-4f09-975f-f0bc59147a58", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "default:Python", "language": "python", "name": "conda-env-default-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.16" } }, "nbformat": 4, "nbformat_minor": 5 }