Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save appliedintelligencelab/d403809ca668d038a3873bf5a9e1ca2c to your computer and use it in GitHub Desktop.

Select an option

Save appliedintelligencelab/d403809ca668d038a3873bf5a9e1ca2c to your computer and use it in GitHub Desktop.
stable_diffusion_sdxl_on_google_colab.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "T4",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/appliedintelligencelab/d403809ca668d038a3873bf5a9e1ca2c/stable_diffusion_sdxl_on_google_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"# Vídeo Tutorial: https://www.youtube.com/watch?v=I3P__MnBYyQ\n",
"## Como usar Stable Diffusion SD-XL no Google Colab\n",
"A GPU T4 grátis do Colab funciona, mas usar outras GPUs vai mais o processo ser mais rápido e estável!\n",
"\n",
"Ao baixar os modelos oficiais do SD-XL você precisa aceitar os termos do modelo [base](https://huggingface.co/stabilityai/stable-diffusion-xl-base-0.9) e [refiner](https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-0.9) e criar um token de acesso no [HuggingFace](https://huggingface.co/settings/tokens).\n",
"\n"
],
"metadata": {
"id": "R1Kus3q-Sl9a"
}
},
{
"cell_type": "code",
"source": [
"access_token=\"put_your_token_here\""
],
"metadata": {
"id": "C-SrHtOFO_2U"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "u9v9keo_Ob1u"
},
"outputs": [],
"source": [
"!git clone https://github.com/appliedintelligencelab/stable-diffusion-xl-demo\n",
"%cd stable-diffusion-xl-demo\n",
"\n",
"!pip install -r requirements3.txt"
]
},
{
"cell_type": "markdown",
"source": [
"## Rode a celula abaixo e clique no link público para acessar a demo.\n",
"\n",
"Em caso de dúvidas acesse o Vídeo Tutorial acima e deixe seu comentário."
],
"metadata": {
"id": "Ukiyc7GkTNY9"
}
},
{
"cell_type": "code",
"source": [
"# Refiner is disabled by default due to a lack of system memory in the free tier of Colab. You can enable it by setting `ENABLE_REFINER=true`.\n",
"!PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128 ACCESS_TOKEN={access_token} SHARE=true ENABLE_REFINER=false python app6.py"
],
"metadata": {
"id": "QqV3rnyiPBhR"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment