Skip to content

Commit

Permalink
fix model downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
ddPn08 committed Dec 19, 2022
1 parent 5f78132 commit 69c7aed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions automatic1111.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"data_dir = \"/content/data\" # @param {type:\"string\"}\n",
"\n",
"# @markdown **Optional | Download the model if it isn't already in the `{data_dir}/models` folder**\n",
"download_if_missing = True # @param {type:\"boolean\"}\n",
"download_if_missing = False # @param {type:\"boolean\"}\n",
"model_url = \"https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt\" # @param {type:\"string\"}\n",
"model_filename = \"\" # @param {type:\"string\"}\n",
"auth_token = \"\" # @param {type:\"string\"}\n",
Expand Down Expand Up @@ -159,6 +159,7 @@
" if mount_google_drive and not mount_success:\n",
" print(f\"Downloading model to {models_path} due to gdrive mount error\")\n",
" elif not model_filename or not os.path.exists(f\"{data_dir}/models/{model_filename}\"):\n",
" os.makedirs(f\"{models_path}/Stable-diffusion\", exist_ok=True)\n",
" ! curl -LJ {model_url} -o {models_path}/Stable-diffusion/{model_filename} {'-H \"Authorization: Bearer ' + auth_token + '\"' if auth_token else \"\"}\n",
" else:\n",
" print(\"Model already downloaded, moving to next step\")"
Expand Down Expand Up @@ -362,8 +363,8 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Y4ebYsPqTrGb",
"cellView": "form"
"cellView": "form",
"id": "Y4ebYsPqTrGb"
},
"outputs": [],
"source": [
Expand Down

0 comments on commit 69c7aed

Please sign in to comment.