Skip to content

Commit

Permalink
Создано в Colab
Browse files Browse the repository at this point in the history
  • Loading branch information
shaitanzx committed Jul 21, 2024
1 parent 7b32a71 commit d9e4cb5
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions Fooocus_extend_wo_update.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "-qs4_BtBM46P",
"cellView": "form"
},
"outputs": [],
"source": [
"# @markdown # Select profile of Fooocus and start/restart\n",
"\n",
"Fooocus_Profile = \"realistic\" #@param [\"default\", \"realistic\", \"anime\"]\n",
"Fooocus_Theme = \"dark\" #@param [\"dark\", \"light\"]\n",
"Tunnel = \"gradio\" #@param [\"gradio\", \"cloudflared\"]\n",
"\n",
"!pip install pygit2==1.12.2\n",
"%cd /content\n",
"!git clone https://github.com/shaitanzx/Fooocus_extend.git\n",
"!mkdir /content/Fooocus_extend/batch_images\n",
"if Tunnel=='cloudflared':\n",
" !wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb\n",
" !dpkg -i cloudflared-linux-amd64.deb\n",
" %cd /content/Fooocus_extend\n",
" !wget -O /content/Fooocus_extend/patcher_tunel.py https://github.com/shaitanzx/Fooocus_extend/raw/main/patcher_tunel.py\n",
" !python /content/Fooocus_extend/patcher_tunel.py\n",
" !rm /content/Fooocus_extend/patcher_tunel.py\n",
"\n",
"Memory_patch = True #@param {type:\"boolean\"}\n",
"patch=\"\"\n",
"if Memory_patch == True :\n",
" patch=\"--always-high-vram --all-in-fp16\"\n",
"\n",
"GoogleDrive_output = True #@param {type:\"boolean\"}\n",
"output_foder=\"\"\n",
"if GoogleDrive_output == True :\n",
" from google.colab import drive\n",
" drive.mount('/content/drive', force_remount=True)\n",
" output_foder=\"--output-path /content/drive/MyDrive/outputs\"\n",
" !mkdir /content/drive/MyDrive/outputs\n",
"\n",
"%cd /content\n",
"# begin module for synchronization\n",
"!pip install rembg==2.0.53\n",
"# end modulw for synchronization\n",
"\n",
"\n",
"\n",
"%cd /content/Fooocus_extend\n",
"#run foocus\n",
"if Fooocus_Profile=='default':\n",
" profile=\"\"\n",
"if Fooocus_Profile=='realistic':\n",
" profile=\"--preset realistic\"\n",
"if Fooocus_Profile=='anime':\n",
" profile=\"--preset anime\"\n",
"\n",
"if Fooocus_Theme=='dark':\n",
" theme=\"--theme dark\"\n",
"if Fooocus_Theme=='light':\n",
" theme=\"\"\n",
"\n",
"!python launch.py {profile} {theme} --share {patch} {output_foder}"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"gpuType": "T4",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit d9e4cb5

Please sign in to comment.