Skip to content

Commit

Permalink
Fix check for updates in all Web UI
Browse files Browse the repository at this point in the history
Took 9 minutes
  • Loading branch information
ffxvs committed May 20, 2024
1 parent 8cbf73d commit 1c9bdd3
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 133 deletions.
54 changes: 24 additions & 30 deletions sd-webui-forge/sd_webui_forge_paperspace.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,44 @@
"source": [
"### Check for Updates\n",
"\n",
"**Version : 2024.03.24**"
"**Version : 2024.05.20**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.utils import capture \n",
"import requests\n",
"import ipywidgets as widgets\n",
"from IPython.utils import capture\n",
"\n",
"button = widgets.Button(description=\"Download now\", button_style='success')\n",
"output = widgets.Output()\n",
"\n",
"def on_button_clicked(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_forge_paperspace_{version}.ipynb {url}\n",
" print(f'sd_webui_forge_paperspace_{version}.ipynb downloaded in the root directory')\n",
"\n",
"currentVersion = '2024.03.24'\n",
"currentVersion = '2024.05.20'\n",
"updateURL = 'https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/updates.json'\n",
"res = requests.get(updateURL)\n",
"output = widgets.Output()\n",
"\n",
"def onClick(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_forge_paperspace_{version}.ipynb {url}\n",
" print(f'sd_webui_forge_paperspace_{version}.ipynb downloaded in the root directory')\n",
"\n",
"if res.status_code == 200:\n",
" for notebook in res.json()['paperspace']:\n",
" if notebook['id'] == 'forge':\n",
" print('Current version : ' + currentVersion)\n",
" print('Latest version : ' + notebook['version'])\n",
" if (notebook['version'] > currentVersion):\n",
" print('\\nThere is new version')\n",
" button.on_click(lambda b: on_button_clicked(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print('\\nChangelog :')\n",
" print(notebook['changelog'])\n",
" else:\n",
" print('\\nThis is the latest version') \n",
" notebook = next((n for n in res.json()['paperspace'] if n['id'] == 'forge'), None)\n",
" if notebook:\n",
" print(f'Current version : {currentVersion}\\nLatest version : {notebook[\"version\"]}')\n",
" if notebook['version'] > currentVersion:\n",
" print('\\nThere is new version')\n",
" button = widgets.Button(description=\"Download now\", button_style='success')\n",
" button.on_click(lambda b: onClick(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print(f'\\nChangelog :\\n{notebook[\"changelog\"]}')\n",
" else:\n",
" print('\\nThis is the latest version')\n",
"else:\n",
" print('Failed to check for updates') \n",
" print('Response code :', res.status_code)"
" print(f'Failed to check for updates\\nResponse code : {res.status_code}')"
]
},
{
Expand Down
54 changes: 24 additions & 30 deletions sd-webui-forge/sd_webui_forge_runpod.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,44 @@
"source": [
"### Check for Updates\n",
"\n",
"**Version : 2024.03.20**"
"**Version : 2024.05.20**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.utils import capture \n",
"import requests\n",
"import ipywidgets as widgets\n",
"from IPython.utils import capture\n",
"\n",
"button = widgets.Button(description=\"Download now\", button_style='success')\n",
"output = widgets.Output()\n",
"\n",
"def on_button_clicked(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_forge_runpod_{version}.ipynb {url}\n",
" print(f'sd_webui_forge_runpod_{version}.ipynb downloaded in the root directory')\n",
"\n",
"currentVersion = '2024.03.20'\n",
"currentVersion = '2024.05.20'\n",
"updateURL = 'https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/updates.json'\n",
"res = requests.get(updateURL)\n",
"output = widgets.Output()\n",
"\n",
"def onClick(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_forge_runpod_{version}.ipynb {url}\n",
" print(f'sd_webui_forge_runpod_{version}.ipynb downloaded in the root directory')\n",
"\n",
"if res.status_code == 200:\n",
" for notebook in res.json()['runpod']:\n",
" if notebook['id'] == 'forge':\n",
" print('Current version : ' + currentVersion)\n",
" print('Latest version : ' + notebook['version'])\n",
" if (notebook['version'] > currentVersion):\n",
" print('\\nThere is new version')\n",
" button.on_click(lambda b: on_button_clicked(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print('\\nChangelog :')\n",
" print(notebook['changelog'])\n",
" else:\n",
" print('\\nThis is the latest version') \n",
" notebook = next((n for n in res.json()['runpod'] if n['id'] == 'forge'), None)\n",
" if notebook:\n",
" print(f'Current version : {currentVersion}\\nLatest version : {notebook[\"version\"]}')\n",
" if notebook['version'] > currentVersion:\n",
" print('\\nThere is new version')\n",
" button = widgets.Button(description=\"Download now\", button_style='success')\n",
" button.on_click(lambda b: onClick(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print(f'\\nChangelog :\\n{notebook[\"changelog\"]}')\n",
" else:\n",
" print('\\nThis is the latest version')\n",
"else:\n",
" print('Failed to check for updates') \n",
" print('Response code :', res.status_code)"
" print(f'Failed to check for updates\\nResponse code : {res.status_code}')"
]
},
{
Expand Down
57 changes: 24 additions & 33 deletions sd-webui/sd_webui_paperspace.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"metadata": {},
"source": [
"## Stable Diffusion Web UI\n",
"**If you are from a version prior to 2024.03.05, you need to create a new Paperspace's notebook inside Paperspace's project. \n",
"Read the instructions in the [readme](https://github.com/ffxvs/sd-webui-complete-setup#paperspace)**\n",
"\n",
"**Homepage :** [SD Web UI Complete setup](https://github.com/ffxvs/sd-webui-complete-setup) \n",
"**Guide :** [Paperspace Guide](https://github.com/ffxvs/sd-webui-complete-setup/wiki/Paperspace-Guide)"
]
Expand All @@ -21,50 +18,44 @@
"source": [
"### Check for Updates\n",
"\n",
"**Version : 2024.03.24**"
"**Version : 2024.05.20**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.utils import capture \n",
"import requests\n",
"import ipywidgets as widgets\n",
"from IPython.utils import capture\n",
"\n",
"button = widgets.Button(description=\"Download now\", button_style='success')\n",
"output = widgets.Output()\n",
"\n",
"def on_button_clicked(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_paperspace_{version}.ipynb {url}\n",
" print(f'sd_webui_paperspace_{version}.ipynb downloaded in the root directory')\n",
"\n",
"currentVersion = '2024.03.24'\n",
"currentVersion = '2024.05.20'\n",
"updateURL = 'https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/updates.json'\n",
"res = requests.get(updateURL)\n",
"output = widgets.Output()\n",
"\n",
"def onClick(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_paperspace_{version}.ipynb {url}\n",
" print(f'sd_webui_paperspace_{version}.ipynb downloaded in the root directory')\n",
"\n",
"if res.status_code == 200:\n",
" for notebook in res.json()['paperspace']:\n",
" if notebook['id'] == 'auto1111':\n",
" print('Current version : ' + currentVersion)\n",
" print('Latest version : ' + notebook['version'])\n",
" if (notebook['version'] > currentVersion):\n",
" print('\\nThere is new version')\n",
" button.on_click(lambda b: on_button_clicked(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print('\\nChangelog :')\n",
" print(notebook['changelog'])\n",
" else:\n",
" print('\\nThis is the latest version') \n",
" notebook = next((n for n in res.json()['paperspace'] if n['id'] == 'auto1111'), None)\n",
" if notebook:\n",
" print(f'Current version : {currentVersion}\\nLatest version : {notebook[\"version\"]}')\n",
" if notebook['version'] > currentVersion:\n",
" print('\\nThere is new version')\n",
" button = widgets.Button(description=\"Download now\", button_style='success')\n",
" button.on_click(lambda b: onClick(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print(f'\\nChangelog :\\n{notebook[\"changelog\"]}')\n",
" else:\n",
" print('\\nThis is the latest version')\n",
"else:\n",
" print('Failed to check for updates') \n",
" print('Response code :', res.status_code)"
" print(f'Failed to check for updates\\nResponse code : {res.status_code}')"
]
},
{
Expand Down
56 changes: 24 additions & 32 deletions sd-webui/sd_webui_runpod.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"metadata": {},
"source": [
"## Stable Diffusion Web UI\n",
"**If you are from a version prior to 2024.03.05, you need to create a new Pod. \n",
"Read the instructions in the [readme](https://github.com/ffxvs/sd-webui-complete-setup#runpod)**\n",
"\n",
"**Homepage :** [SD Web UI Complete setup](https://github.com/ffxvs/sd-webui-complete-setup) \n",
"**Guide :** [Runpod Guide](https://github.com/ffxvs/sd-webui-complete-setup/wiki/Runpod-Guide)"
Expand All @@ -21,50 +19,44 @@
"source": [
"### Check for Updates\n",
"\n",
"**Version : 2024.03.20**"
"**Version : 2024.05.20**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.utils import capture \n",
"import requests\n",
"import ipywidgets as widgets\n",
"from IPython.utils import capture\n",
"\n",
"button = widgets.Button(description=\"Download now\", button_style='success')\n",
"output = widgets.Output()\n",
"\n",
"def on_button_clicked(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_runpod_{version}.ipynb {url}\n",
" print(f'sd_webui_runpod_{version}.ipynb downloaded in the root directory')\n",
"\n",
"currentVersion = '2024.03.20'\n",
"currentVersion = '2024.05.20'\n",
"updateURL = 'https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/updates.json'\n",
"res = requests.get(updateURL)\n",
"output = widgets.Output()\n",
"\n",
"def onClick(b, url, version):\n",
" with output:\n",
" print('Downloading...')\n",
" !wget -nv -O /notebooks/sd_webui_runpod_{version}.ipynb {url}\n",
" print(f'sd_webui_runpod_{version}.ipynb downloaded in the root directory')\n",
"\n",
"if res.status_code == 200:\n",
" for notebook in res.json()['runpod']:\n",
" if notebook['id'] == 'auto1111':\n",
" print('Current version : ' + currentVersion)\n",
" print('Latest version : ' + notebook['version'])\n",
" if (notebook['version'] > currentVersion):\n",
" print('\\nThere is new version')\n",
" button.on_click(lambda b: on_button_clicked(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print('\\nChangelog :')\n",
" print(notebook['changelog'])\n",
" else:\n",
" print('\\nThis is the latest version') \n",
" notebook = next((n for n in res.json()['runpod'] if n['id'] == 'auto1111'), None)\n",
" if notebook:\n",
" print(f'Current version : {currentVersion}\\nLatest version : {notebook[\"version\"]}')\n",
" if notebook['version'] > currentVersion:\n",
" print('\\nThere is new version')\n",
" button = widgets.Button(description=\"Download now\", button_style='success')\n",
" button.on_click(lambda b: onClick(b, notebook['url'], notebook['version']))\n",
" display(button, output)\n",
" print(f'\\nChangelog :\\n{notebook[\"changelog\"]}')\n",
" else:\n",
" print('\\nThis is the latest version')\n",
"else:\n",
" print('Failed to check for updates') \n",
" print('Response code :', res.status_code)"
" print(f'Failed to check for updates\\nResponse code : {res.status_code}')"
]
},
{
Expand Down
16 changes: 8 additions & 8 deletions updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
"paperspace": [
{
"id": "auto1111",
"version": "2024.03.24",
"version": "2024.05.20",
"url": "https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/sd-webui/sd_webui_paperspace.ipynb",
"changelog": "Temporarily disable ngrok"
"changelog": "Fix Check for updates"
},
{
"id": "forge",
"version": "2024.03.24",
"version": "2024.05.20",
"url": "https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/sd-webui-forge/sd_webui_forge_paperspace.ipynb",
"changelog": "Temporarily disable ngrok"
"changelog": "Fix Check for updates"
}
],
"runpod": [
{
"id": "auto1111",
"version": "2024.03.20",
"version": "2024.05.20",
"url": "https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/sd-webui/sd_webui_runpod.ipynb",
"changelog": "Add Web UI authentication"
"changelog": "Fix Check for updates"
},
{
"id": "forge",
"version": "2024.03.20",
"version": "2024.05.20",
"url": "https://raw.githubusercontent.com/ffxvs/sd-webui-complete-setup/main/sd-webui-forge/sd_webui_forge_runpod.ipynb",
"changelog": "Add Web UI authentication"
"changelog": "Fix Check for updates"
}
],
"resources": [
Expand Down

0 comments on commit 1c9bdd3

Please sign in to comment.