compress output for exporting

Former-commit-id: 73309c0ad1
This commit is contained in:
Cyberes 2022-09-09 15:48:47 -06:00 committed by GitHub
parent ad7ce3411b
commit 5c394af770
1 changed files with 57 additions and 3 deletions

View File

@ -115,7 +115,6 @@
"cell_type": "markdown",
"metadata": {
"id": "F0EINk5M0s-w",
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
@ -253,7 +252,7 @@
"source": [
"**Half-size Model**\n",
"\n",
"If you're on free tier try this first."
"If you're on free tier try this first, it's 3.5GB."
]
},
{
@ -374,7 +373,62 @@
" print('You forgot to fill out the variable model_file above.')\n",
" sys.exit(1)\n",
"\n",
"!python /notebooks/stable-diffusion-webui/webui.py --share --ckpt $model_file --show-negative-prompt"
"!python /notebooks/stable-diffusion-webui/webui.py --share --ckpt $model_file --show-negative-prompt --no-progressbar-hiding"
]
},
{
"cell_type": "markdown",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"# Export Generations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This block will compress the outputs with 7zip max compression then delete the originals. It expects you to have `log/` and `outputs/` in `/notebooks/`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!apt install -y p7zip-full\n",
"from datetime import datetime\n",
"import os\n",
"datetime_str = datetime.now().strftime('%m-%d-%Y_%H:%M:%S')\n",
"%cd /notebooks/\n",
"!mkdir $datetime_str\n",
"!mv log $datetime_str\n",
"!mv outputs $datetime_str\n",
"os.system(f'7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on {datetime_str}.7z {datetime_str}/')"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"### Delete old output folder\n",
"\n",
"This block will delete the folder you just compressed."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!rm -rf /notebooks/$datetime_str/\n",
"!echo Deleted /notebooks/$datetime_str/"
]
}
],