{ "cells": [ { "cell_type": "code", "source": [ "!git clone https://github.com/bamps53/diffusers\n", "%cd diffusers\n", "!git checkout a7546b79994e1cea7dc9d5a288df758a76201ee8\n", "!pip install -e \".[dev]\"" ], "metadata": { "id": "ZNgWSJQ-BViA", "outputId": "3956d806-fc52-467d-e73f-a09961ed147d", "colab": { "base_uri": "https://localhost:8080/" } }, "id": "ZNgWSJQ-BViA", "execution_count": 1, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/diffusers\n" ] } ] }, { "cell_type": "code", "source": [ "!wget https://huggingface.co/sayakpaul/test-model-card-template-dreambooth/resolve/main/image_0.png\n", "!wget https://huggingface.co/sayakpaul/test-model-card-template-dreambooth/resolve/main/image_1.png\n", "!wget https://huggingface.co/sayakpaul/test-model-card-template-dreambooth/resolve/main/image_2.png" ], "metadata": { "id": "pdpDJAul40ZB", "outputId": "d6dbe2fa-c611-48dc-ed28-af4341f0e33e", "colab": { "base_uri": "https://localhost:8080/" } }, "id": "pdpDJAul40ZB", "execution_count": 8, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "--2024-02-08 13:23:49-- https://huggingface.co/sayakpaul/test-model-card-template-dreambooth/resolve/main/image_1.png\n", "Resolving huggingface.co (huggingface.co)... 18.67.181.126, 18.67.181.36, 18.67.181.124, ...\n", "Connecting to huggingface.co (huggingface.co)|18.67.181.126|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 386612 (378K) [image/png]\n", "Saving to: ‘image_1.png’\n", "\n", "image_1.png 100%[===================>] 377.55K 501KB/s in 0.8s \n", "\n", "2024-02-08 13:23:50 (501 KB/s) - ‘image_1.png’ saved [386612/386612]\n", "\n", "--2024-02-08 13:23:51-- https://huggingface.co/sayakpaul/test-model-card-template-dreambooth/resolve/main/image_2.png\n", "Resolving huggingface.co (huggingface.co)... 18.67.181.126, 18.67.181.36, 18.67.181.124, ...\n", "Connecting to huggingface.co (huggingface.co)|18.67.181.126|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 386612 (378K) [image/png]\n", "Saving to: ‘image_2.png’\n", "\n", "image_2.png 100%[===================>] 377.55K 503KB/s in 0.8s \n", "\n", "2024-02-08 13:23:52 (503 KB/s) - ‘image_2.png’ saved [386612/386612]\n", "\n" ] } ] }, { "cell_type": "code", "source": [ "from diffusers.utils import load_image\n", "from examples.controlnet.train_controlnet import save_model_card\n", "\n", "images = [load_image(f\"image_{i}.png\") for i in range(3)]\n", "\n", "image_logs = [\n", " dict(\n", " images=[image],\n", " validation_prompt=\"validation_prompt\",\n", " validation_image=image,\n", " )\n", " for image in images\n", "]\n", "save_model_card(\n", " repo_id=\"camaro/test\",\n", " image_logs=image_logs,\n", " base_model=\"runwayml/stable-diffusion-v1-5\",\n", " repo_folder=\".\",\n", ")" ], "metadata": { "id": "v7vs7eQyDeX1" }, "id": "v7vs7eQyDeX1", "execution_count": 9, "outputs": [] }, { "cell_type": "code", "execution_count": 10, "id": "b19ff19c-fff0-469f-b004-dd731edbffa9", "metadata": { "id": "b19ff19c-fff0-469f-b004-dd731edbffa9", "outputId": "b8682622-e0ce-4015-91a3-2e5b018f1c4f", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "---\n", "license: creativeml-openrail-m\n", "library_name: diffusers\n", "tags:\n", "- stable-diffusion\n", "- stable-diffusion-diffusers\n", "- text-to-image\n", "- diffusers\n", "- controlnet\n", "inference: true\n", "base_model: runwayml/stable-diffusion-v1-5\n", "---\n", "\n", "\n", "\n", "\n", "# controlnet-camaro/test\n", "\n", "These are controlnet weights trained on runwayml/stable-diffusion-v1-5 with new type of conditioning.\n", "You can find some example images below.\n", "prompt: validation_prompt\n", "![images_0)](./images_0.png)\n", "prompt: validation_prompt\n", "![images_1)](./images_1.png)\n", "prompt: validation_prompt\n", "![images_2)](./images_2.png)\n", "\n", "\n", "\n", "## Intended uses & limitations\n", "\n", "#### How to use\n", "\n", "```python\n", "# TODO: add an example code snippet for running this diffusion pipeline\n", "```\n", "\n", "#### Limitations and bias\n", "\n", "[TODO: provide examples of latent issues and potential remediations]\n", "\n", "## Training details\n", "\n", "[TODO: describe the data used to train the model]" ] } ], "source": [ "!cat README.md" ] }, { "cell_type": "code", "source": [], "metadata": { "id": "Y3uTj1bv5Amw" }, "id": "Y3uTj1bv5Amw", "execution_count": null, "outputs": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.9.17" }, "colab": { "provenance": [], "gpuType": "T4" }, "accelerator": "GPU" }, "nbformat": 4, "nbformat_minor": 5 }