{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "02bc524b-76ce-45ee-a3c2-56ce6fd9ebc8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[35m[\u001b[0m#23908a 2.7GiB/6.4GiB\u001b[36m(41%)\u001b[0m CN:16 DL:\u001b[32m5.7MiB\u001b[0m ETA:\u001b[33m11m12s\u001b[0m\u001b[35m]\u001b[0m\u001b[0mSD未启动3\n", " *** Download Progress Summary as of Sun Nov 24 23:29:21 2024 *** m11m3s\u001b[0m\u001b[35m]\u001b[0m\u001b[0m\n", "===============================================================================\n", "[#23908a 2.7GiB/6.4GiB(42%) CN:16 DL:5.6MiB ETA:11m21s]\n", "FILE: /tmp/code/sd/stable-diffusion-webui/models/Stable-diffusion/动漫-NoobAI-XL_Epsilon-pred.1.0-Version.safetensors\n", "-------------------------------------------------------------------------------\n", "\n", "\u001b[35m[\u001b[0m#23908a 2.7GiB/6.4GiB\u001b[36m(42%)\u001b[0m CN:16 DL:\u001b[32m5.9MiB\u001b[0m ETA:\u001b[33m10m43s\u001b[0m\u001b[35m]\u001b[0m\u001b[0mSD未启动3\n", "\u001b[35m[\u001b[0m#23908a 2.7GiB/6.4GiB\u001b[36m(42%)\u001b[0m CN:16 DL:\u001b[32m5.6MiB\u001b[0m ETA:\u001b[33m11m13s\u001b[0m\u001b[35m]\u001b[0m\u001b[0mSD未启动3\n", "\u001b[35m[\u001b[0m#23908a 2.7GiB/6.4GiB\u001b[36m(43%)\u001b[0m CN:16 DL:\u001b[32m5.7MiB\u001b[0m ETA:\u001b[33m10m53s\u001b[0m\u001b[35m]\u001b[0m\u001b[0mSD未启动3\n", " *** Download Progress Summary as of Sun Nov 24 23:29:37 2024 *** m10m19s\u001b[0m\u001b[35m]\u001b[0m\u001b[0m\n", "===============================================================================\n", "[#23908a 2.8GiB/6.4GiB(43%) CN:16 DL:5.9MiB ETA:10m24s]\n", "FILE: /tmp/code/sd/stable-diffusion-webui/models/Stable-diffusion/动漫-NoobAI-XL_Epsilon-pred.1.0-Version.safetensors\n", "-------------------------------------------------------------------------------\n", "\n", "\u001b[35m[\u001b[0m#23908a 2.8GiB/6.4GiB\u001b[36m(43%)\u001b[0m CN:16 DL:\u001b[32m5.9MiB\u001b[0m ETA:\u001b[33m10m26s\u001b[0m\u001b[35m]\u001b[0m\u001b[0mSD未启动3\n", "\u001b[35m[\u001b[0m#23908a 2.8GiB/6.4GiB\u001b[36m(43%)\u001b[0m CN:16 DL:\u001b[32m5.7MiB\u001b[0m ETA:\u001b[33m10m51s\u001b[0m\u001b[35m]\u001b[0m\u001b[0m" ] } ], "source": [ "import time\n", "from IPython.display import clear_output\n", "import os\n", "import threading\n", "server_lock = threading.Lock()\n", "def server():\n", " while True:\n", " with server_lock:\n", " !mr -r /tmp/code/main.py\n", " !wget -O /tmp/code/main.py 'https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/main.py'\n", " !python /tmp/code/main.py\n", " time.sleep(60)\n", "\n", "def clear_output_periodically():\n", " while True:\n", " clear_output()\n", " time.sleep(600)\n", "threading.Thread(target=server, daemon=True).start()\n", "!rm /tmp/code/server.py\n", "!wget -O /tmp/code/server.py https://hf-mirror.com/datasets/Qi28/SD_QZ/resolve/main/server.py\n", "threading.Thread(target=clear_output_periodically, daemon=True).start()\n", "!python /tmp/code/server.py" ] }, { "cell_type": "code", "execution_count": null, "id": "84d9ec6d-c37b-4f34-8b55-f5622c335dfd", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 5 }