kanoyo commited on
Commit
8ec47c1
·
1 Parent(s): 5f853e8

Upload Untitled8.ipynb

Browse files
Files changed (1) hide show
  1. Untitled8.ipynb +107 -0
Untitled8.ipynb ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": [],
7
+ "gpuType": "T4"
8
+ },
9
+ "kernelspec": {
10
+ "name": "python3",
11
+ "display_name": "Python 3"
12
+ },
13
+ "language_info": {
14
+ "name": "python"
15
+ },
16
+ "accelerator": "GPU"
17
+ },
18
+ "cells": [
19
+ {
20
+ "cell_type": "code",
21
+ "execution_count": null,
22
+ "metadata": {
23
+ "cellView": "form",
24
+ "id": "wFgrg706HRBk"
25
+ },
26
+ "outputs": [],
27
+ "source": [
28
+ "#@title # 🤖 1. LỰA CHỌN MODEL\n",
29
+ "import codecs\n",
30
+ "import os\n",
31
+ "from google.colab import drive\n",
32
+ "drive.mount('/content/drive')\n",
33
+ "%cd /content\n",
34
+ "\n",
35
+ "# Cai dat tcmalloc\n",
36
+ "!apt -y update -qq\n",
37
+ "!apt-get install libgoogle-perftools4 libtcmalloc-minimal4 -y\n",
38
+ "!apt -y install -qq aria2\n",
39
+ "%env LD_PRELOAD=libtcmalloc_minimal.so.4.5.9\n",
40
+ "\n",
41
+ "# Giao diện\n",
42
+ "\n",
43
+ "mode = 'dark'\n",
44
+ "down = codecs.decode('uggcf://enj.tvguhohfrepbagrag.pbz/zvauaung0709/fq-pbyno-pbasvt/znva/ercbfvgbevrf_yvax.gkg', 'rot_13')\n",
45
+ "!aria2c --continue --console-log-level=error -c -x 16 -s 16 -k 1M $down -d /content -o links.txt\n",
46
+ "with open(\"/content/links.txt\") as file:\n",
47
+ " links = file.readlines()\n",
48
+ "\n",
49
+ "url = links[0]\n",
50
+ "repo_name_start_index = url.rfind(\"/\") + 1\n",
51
+ "repo_name = url[repo_name_start_index:].strip()\n",
52
+ "\n",
53
+ "gitUrl = url\n",
54
+ "gitFolder = repo_name\n",
55
+ "\n",
56
+ "!git clone $gitUrl\n",
57
+ "#Extension\n",
58
+ "%cd $gitFolder/extensions\n",
59
+ "for link in links:\n",
60
+ " !git clone $link\n",
61
+ "\n",
62
+ "control_net_folder_name = links[1][(links[1].rfind(\"/\") + 1):].strip()\n",
63
+ "print(control_net_folder_name)\n",
64
+ "\n",
65
+ "%cd ..\n",
66
+ "\n",
67
+ "sdk = codecs.decode('FgnoyrQvsshfvba', 'rot_13')\n",
68
+ "if Model != \"None Model\":\n",
69
+ " model_url = find_model_by_name(model_urls, Model)[\"download_url\"]\n",
70
+ " ckpt = \"/content/drive/MyDrive/$sdk/Model/{}.safetensors\".format(Model)\n",
71
+ " model_download_command = \"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M {} -d /content/drive/MyDrive/$sdk/Model -o {}.safetensors\".format(model_url, Model)\n",
72
+ " !{model_download_command}\n",
73
+ "else:\n",
74
+ " ckpt = \"/content/drive/MyDrive/$sdk/Model/xyz.safetensors\""
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "source": [
80
+ "#@title # 🤖 2.\n",
81
+ "!wget https://huggingface.co/datasets/kanoyo/au1111/resolve/main/download.ipynb\n",
82
+ "%run download.ipynb"
83
+ ],
84
+ "metadata": {
85
+ "cellView": "form",
86
+ "id": "eLf6vZOgRLcr"
87
+ },
88
+ "execution_count": null,
89
+ "outputs": []
90
+ },
91
+ {
92
+ "cell_type": "code",
93
+ "source": [
94
+ "#@title # 🤖 3.\n",
95
+ "import codecs\n",
96
+ "sdk = codecs.decode('FgnoyrQvsshfvba', 'rot_13')\n",
97
+ "!python launch.py --api --share --listen --theme dark --opt-sdp-attention --enable-insecure-extension-access --ui-config-file /content/drive/MyDrive/$sdk/Setting/ui-config.json --ui-settings-file /content/drive/MyDrive/$sdk/Setting/config.json --ckpt $ckpt --ckpt-dir /content/drive/MyDrive/$sdk/Model/ --lora-dir /content/drive/MyDrive/$sdk/Lora/ --eliai-lora-dir /content/drive/MyDrive/$sdk/EliAILora --embeddings-dir /content/drive/MyDrive/$sdk/Embeddings --styles-file /content/drive/MyDrive/$sdk/Setting/styles.csv --hypernetwork-dir /content/drive/MyDrive/$sdk/Hypernetwork"
98
+ ],
99
+ "metadata": {
100
+ "cellView": "form",
101
+ "id": "6EWQjPRtPuPK"
102
+ },
103
+ "execution_count": null,
104
+ "outputs": []
105
+ }
106
+ ]
107
+ }