Run this model with HF Jobs
Run JosephusCheung/ACertainModel on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/JosephusCheung/ACertainModel. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/JosephusCheung/ACertainModel on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use JosephusCheung/ACertainModel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use JosephusCheung/ACertainModel with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("JosephusCheung/ACertainModel", dtype=torch.bfloat16, device_map="cuda") prompt = "masterpiece, best quality, 1girl, brown hair, green eyes, colorful, autumn, cumulonimbus clouds, lighting, blue sky, falling leaves, garden" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Commit ·
eae4fd4
1
Parent(s): 433142c
Upload ACertainModel_on_SD_WEBUI.ipynb
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "VBDPqhYnyBL1" }, "source": [ "Check GPU" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "woQCdVO8x-Kt" }, "outputs": [], "source": [ "!nvidia-smi" ] }, { "cell_type": "markdown", "metadata": { "id": "OHCtG9MT0jLq" }, "source": [ "Clone webui repository and download the model." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "ZzRNMT42Gw_p" }, "outputs": [], "source": [ "%cd /content\n", "!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui\n", "%cd stable-diffusion-webui\n", "!git pull\n", "!mkdir -p /content/stable-diffusion-webui/models/Stable-diffusion\n", "%cd /content/stable-diffusion-webui/models/Stable-diffusion/\n", "!apt install -y -qq aria2\n", "!aria2c --summary-interval=10 -x 16 -s 16 --allow-overwrite=true -Z https://huggingface.co/JosephusCheung/ACertainModel/resolve/main/ACertainModel-half.ckpt\n", "%cd /content\n", "!aria2c --summary-interval=10 -x 16 -s 16 --allow-overwrite=true -Z https://huggingface.co/JosephusCheung/ACertainModel/resolve/main/animevae.pt" ] }, { "cell_type": "markdown", "metadata": { "id": "xt8lbdmC04ox" }, "source": [ "Launch web ui. You will get a link to nnn.gradio.app, follow it.\n", "\n", "Commandline arguments are:\n", " - `--share` - create online gradio.app link\n", " - `--gradio-debug` - print outputs to console\n", " - `--gradio-auth me:qwerty` - add authentication to gradio: username me, password qwerty" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "R-xAdMA5wxXd", "outputId": "c3f7f6fe-7769-452d-9433-3023c156a244" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Interrupted with signal 2 in <frame at 0x7f1864c71cf0, file '/usr/local/lib/python3.8/dist-packages/gradio/blocks.py', line 1559, code block_thread>\n" ] } ], "source": [ "%cd /content/stable-diffusion-webui\n", "\n", "# hacks to load model in colab\n", "!sed -i 's/map_location=\"cpu\"/map_location=\"cuda\"/g' /content/stable-diffusion-webui/modules/sd_models.py\n", "\n", "!pip install -U -qq pip\n", "!pip install -qq -r requirements.txt\n", "!pip install -qq -U --pre triton\n", "!pip install -qq pytorch_lightning==1.7.7\n", "!pip install https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+189828c.d20221207-cp38-cp38-linux_x86_64.whl\n", "!echo \"\" > /tmp/requirements_empty.txt\n", "!COMMANDLINE_ARGS=\"--xformers --share --gradio-debug --vae-path /content/animevae.pt\" REQS_FILE=\"/tmp/requirements_empty.txt\" python launch.py" ] }, { "cell_type": "markdown", "metadata": { "id": "T3957x2AY7iP" }, "source": [ "commands for ***after*** you have gotten done with a session\n", "============================================================================" ] }, { "cell_type": "markdown", "metadata": { "id": "aCtJffM2ZE06" }, "source": [ "Zip images for downloading on local drive (click the folder icon on the left, the one below {x})" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "TmRqNyiAZCHu" }, "outputs": [], "source": [ "!zip -r /content/stable-diffusion-webui /content/stable-diffusion-webui/outputs " ] }, { "cell_type": "markdown", "metadata": { "id": "tcslU-S2ZNr9" }, "source": [ "Save images to Google Drive **Warning: this will cause google to scan your drive, so if you intend to use this and worry about that kind of stuff, probablly just set this up on a clean account that's just for this colab**" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "-N0lnu-TZOTW" }, "outputs": [], "source": [ "from google.colab import drive # type: ignore\n", "\n", "try:\n", " drive_path = \"/content/drive\"\n", " drive.mount(drive_path,force_remount=False)\n", "except:\n", " print(\"...error mounting drive or with drive path variables\")\n", "\n", "!cp -r \"/content/stable-diffusion-webui/outputs\" \"/content/drive/MyDrive\"" ] } ], "metadata": { "accelerator": "GPU", "colab": { "provenance": [] }, "gpuClass": "premium", "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0}ACertainModel_on_SD_WEBUI.ipynbAdded+175