├── .gitignore ├── LICENSE ├── README.md ├── ai-agents └── how-to-build-free-ai-agents-minions │ ├── README.md │ ├── ollama-agents-minions-thumbnail.png │ └── world_domination.ipynb ├── llamafile └── getting-started-with-llamafile │ ├── README.md │ └── get-startet-with-llamafile-thumbnail.png ├── ollama ├── access-ollama-and-open-webui-remotely │ ├── README.md │ └── ollama-on-the-go-thumbnail.png ├── customize-models │ ├── README.md │ ├── customize-ollama-models-thumbnail.png │ └── yoda-modelfile ├── import-quantized-models-to-ollama │ ├── README.md │ └── gguf-files-ollama-thumbnail.png ├── install-ollama │ ├── README.md │ ├── find-run-command-for-model.png │ └── install-ollama-thumbnail.png ├── ollama-copilot │ ├── README.MD │ └── llama-copilot.png ├── ollama-on-colab │ ├── README.md │ ├── ollama-colab-thumbnail.png │ ├── run-ollama-on-colab-gdrive-storage.ipynb │ └── run-ollama-on-colab.ipynb └── open-webui │ ├── README.md │ └── open-webui-thumnail.png ├── page-assets └── TechXplainator-Banner.png └── stable-diffusion ├── best-sdxl-models ├── README.md ├── images │ ├── best-sdxl-models-thumbnail.png │ ├── copax │ │ ├── 00000-3719253140.png │ │ ├── 00001-2855127902.png │ │ ├── 00002-2570845037.png │ │ ├── 00003-656694883.png │ │ ├── 00004-2617212831.png │ │ ├── 00005-2492830952.png │ │ ├── 00006-887226551.png │ │ ├── 00007-2322571094.png │ │ ├── 00008-1895783298.png │ │ ├── 00009-1272220565.png │ │ ├── 00010-1981171048.png │ │ ├── 00011-2062528106.png │ │ ├── 00012-2222685910.png │ │ ├── 00013-2674118466.png │ │ ├── 00014-552261060.png │ │ ├── 00015-4238506589.png │ │ ├── 00016-3076404424.png │ │ ├── 00017-2597596686.png │ │ ├── 00018-4028737961.png │ │ ├── 00019-519653091.png │ │ ├── 00020-3723691895.png │ │ ├── 00021-248681639.png │ │ ├── 00022-4286404194.png │ │ ├── 00023-2465035406.png │ │ └── 00024-4289984695.png │ ├── dreamshaper │ │ ├── 00000-3719253140.png │ │ ├── 00001-2855127902.png │ │ ├── 00002-2570845037.png │ │ ├── 00003-656694883.png │ │ ├── 00004-2617212831.png │ │ ├── 00005-2492830952.png │ │ ├── 00006-887226551.png │ │ ├── 00007-2322571094.png │ │ ├── 00008-1895783298.png │ │ ├── 00009-1272220565.png │ │ ├── 00010-1981171048.png │ │ ├── 00011-2062528106.png │ │ ├── 00012-2222685910.png │ │ ├── 00013-2674118466.png │ │ ├── 00014-552261060.png │ │ ├── 00015-4238506589.png │ │ ├── 00016-3076404424.png │ │ ├── 00016-3076404427.png │ │ ├── 00017-2597596686.png │ │ ├── 00018-4028737961.png │ │ ├── 00018-4028737964.png │ │ ├── 00019-519653091.png │ │ ├── 00020-3723691895.png │ │ ├── 00021-248681639.png │ │ ├── 00022-4286404194.png │ │ ├── 00023-2465035406.png │ │ └── 00024-4289984695.png │ ├── juggernaut │ │ ├── 00000-3719253140.png │ │ ├── 00001-2855127902.png │ │ ├── 00002-2570845037.png │ │ ├── 00003-656694883.png │ │ ├── 00004-2617212831.png │ │ ├── 00005-2492830952.png │ │ ├── 00006-887226551.png │ │ ├── 00007-2322571094.png │ │ ├── 00008-1895783298.png │ │ ├── 00009-1272220565.png │ │ ├── 00010-1981171048.png │ │ ├── 00011-2062528106.png │ │ ├── 00012-2222685910.png │ │ ├── 00013-2674118466.png │ │ ├── 00014-552261060.png │ │ ├── 00015-4238506589.png │ │ ├── 00016-3076404424.png │ │ ├── 00017-2597596686.png │ │ ├── 00018-4028737961.png │ │ ├── 00019-519653091.png │ │ ├── 00020-3723691895.png │ │ ├── 00021-248681639.png │ │ ├── 00022-4286404194.png │ │ ├── 00023-2465035406.png │ │ └── 00024-4289984695.png │ ├── realvis │ │ ├── 00000-3719253140.png │ │ ├── 00001-2855127902.png │ │ ├── 00002-2570845037.png │ │ ├── 00003-656694883.png │ │ ├── 00004-2617212831.png │ │ ├── 00005-2492830952.png │ │ ├── 00006-887226551.png │ │ ├── 00007-2322571094.png │ │ ├── 00008-1895783298.png │ │ ├── 00009-1272220565.png │ │ ├── 00010-1981171048.png │ │ ├── 00011-2062528106.png │ │ ├── 00012-2222685910.png │ │ ├── 00013-2674118466.png │ │ ├── 00014-552261060.png │ │ ├── 00015-4238506589.png │ │ ├── 00016-3076404424.png │ │ ├── 00017-2597596686.png │ │ ├── 00018-4028737961.png │ │ ├── 00019-519653091.png │ │ ├── 00020-3723691895.png │ │ ├── 00021-248681639.png │ │ ├── 00022-4286404194.png │ │ ├── 00023-2465035406.png │ │ └── 00024-4289984695.png │ └── sdxl-1 │ │ ├── 00000-3719253140.png │ │ ├── 00001-2855127902.png │ │ ├── 00002-2570845037.png │ │ ├── 00003-656694883.png │ │ ├── 00004-2617212831.png │ │ ├── 00005-2492830952.png │ │ ├── 00006-887226551.png │ │ ├── 00007-2322571094.png │ │ ├── 00008-1895783298.png │ │ ├── 00009-1272220565.png │ │ ├── 00010-1981171048.png │ │ ├── 00011-2062528106.png │ │ ├── 00012-2222685910.png │ │ ├── 00013-2674118466.png │ │ ├── 00014-552261060.png │ │ ├── 00015-4238506589.png │ │ ├── 00016-3076404424.png │ │ ├── 00017-2597596686.png │ │ ├── 00018-4028737961.png │ │ ├── 00019-519653091.png │ │ ├── 00020-3723691895.png │ │ ├── 00021-248681639.png │ │ ├── 00022-4286404194.png │ │ ├── 00023-2465035406.png │ │ └── 00024-4289984695.png └── sdxl-model-comparison.md ├── best-ways-of-running-sdxl-on-mac ├── README.md └── images │ └── running-sdxl-mac-thumbnail.png ├── crash-course-for-beginners ├── README.md └── images │ ├── euler-a-cfg-scale.png │ ├── sd-crash-course-thumbnail.png │ ├── sd-first-image.png │ └── top-picks-for-samplers.png ├── install-automatic-1111 ├── README.md ├── images │ ├── homebrew-adjust-path.png │ └── install-sd-automatic-thumbnail.png └── troubleshooting.md ├── install-comfyui ├── README.md └── images │ ├── error-pytorch-externally-managed.png │ ├── error-requirement-installation.png │ ├── homebrew-adjust-path.png │ └── installation-selector.png ├── stable-diffusion-models-explained ├── README.md └── images │ ├── anything-v3.png │ ├── base-and-finetuned-models.drawio.svg │ ├── base-and-finetuned-models.png │ ├── dreamshaper.png │ ├── model-size.png │ ├── realistic-vision.png │ ├── sd-models-explained-thumbnail.png │ ├── sd-v1_5-01.png │ ├── sd-v2_0-01.png │ ├── sd-v2_1.png │ └── sdxl-image.png ├── switch-between-models-in-AUTOMATIC1111 ├── README.md └── images │ └── sd-switch-models-thumbnail.png └── write-better-prompts-for-stable-diffusion ├── 01-prompt-formula-subject.md ├── 02-prompt-formula-medium.md ├── 03-prompt-formula-style.md ├── 04-prompt-formula-aesthetics.md ├── 05-prompt-formula-quality.md ├── README.md ├── images ├── aesthetics │ ├── .DS_Store │ ├── bar.png │ ├── cat.png │ ├── city-birds-eye.png │ ├── daisy.png │ ├── man.png │ ├── monkeys.png │ └── unicorn.png ├── medium │ ├── black-white-street.png │ ├── cat-in-cardbox.png │ ├── cheerful-young-woman-in-garden.png │ ├── city-with-commuters.png │ ├── cute-alien.png │ ├── cute-black-cat.png │ ├── enchanted-forest.png │ ├── ink-drawing-mountains.png │ ├── owl.png │ ├── pixel-fairy.png │ └── pizza-in-restaurant.png ├── prompt-editing │ ├── Elba-Depp.jpeg │ ├── bar.png │ ├── mountain-lake.jpeg │ └── pig-monkey.png ├── quality │ ├── cyborg.png │ ├── landscape-magic.png │ ├── landscape.png │ ├── morgan-freeman.png │ └── pyramids.png ├── sd-better-prompts-01-thumbnail.png ├── sd-better-prompts-02-thumbnail.png ├── style │ ├── .DS_Store │ ├── Lollipop.png │ ├── cheerful-young-woman-in-garden.png │ ├── city.png │ ├── construction-site.png │ ├── cute-black-cat.png │ ├── donald-duck.png │ ├── fairy.png │ ├── strawberry.png │ ├── tennis-ball.png │ ├── unicorn.png │ └── woman-in-qipao.png └── subject │ ├── .DS_Store │ ├── cat-in-cardbox.png │ ├── cheerful-young-woman-in-garden.png │ ├── children-playing.png │ ├── city-with-commuters.png │ ├── cute-black-cat.png │ ├── enchanted-forest.png │ ├── owl.png │ ├── pizza-in-restaurant.png │ ├── sports-car.png │ ├── stars-in-night-sky.png │ └── waves-on-beach.png └── prompt-editing.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 110 | .pdm.toml 111 | .pdm-python 112 | .pdm-build/ 113 | 114 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 115 | __pypackages__/ 116 | 117 | # Celery stuff 118 | celerybeat-schedule 119 | celerybeat.pid 120 | 121 | # SageMath parsed files 122 | *.sage.py 123 | 124 | # Environments 125 | .env 126 | .venv 127 | env/ 128 | venv/ 129 | ENV/ 130 | env.bak/ 131 | venv.bak/ 132 | 133 | # Spyder project settings 134 | .spyderproject 135 | .spyproject 136 | 137 | # Rope project settings 138 | .ropeproject 139 | 140 | # mkdocs documentation 141 | /site 142 | 143 | # mypy 144 | .mypy_cache/ 145 | .dmypy.json 146 | dmypy.json 147 | 148 | # Pyre type checker 149 | .pyre/ 150 | 151 | # pytype static type analyzer 152 | .pytype/ 153 | 154 | # Cython debug symbols 155 | cython_debug/ 156 | 157 | # PyCharm 158 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 159 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 160 | # and can be added to the global gitignore or merged into this file. For a more nuclear 161 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 162 | #.idea/ 163 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 TechXplainator 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | ![TechXplainator-Banner](/page-assets/TechXplainator-Banner.png) 3 | 4 | ## Welcome to TechXplainator's Tutorials Repository! 5 | 6 | Hi, I'm TechXplainator! 7 | 8 | You're here because you want to learn something new, and that's awesome! 9 | 10 | In this repository, you'll find a collection of tutorials on various topics, from programming to tech-related skills. 11 | 12 | ## What you can expect 13 | 14 | * Practical guides and projects to help you get started with new technologies 15 | * Step-by-step explanations for common issues or problems 16 | * Code examples and resources to support your learning journey 17 | 18 | ## Learn more about me 19 | 20 | Check out my homepage at [techxplainator.com](https://techxplainator.com/) to learn more about my background, interests, and other projects. 21 | 22 | ## Tutorials 23 | 24 | Start exploring the tutorials in this repository, and don't forget to check out my [YouTube channel](https://www.youtube.com/@TechXplainator) for video versions of these tutorials! 25 | 26 | Happy coding! 27 | 28 | TechXplainator 29 | 30 | ### Ollama Tutorials 31 | * [Installation guide for Ollama](/ollama/install-ollama/README.md) 32 | * [Open WebUI for Ollama installation guide](/ollama/open-webui/README.md) 33 | * [Customize models in Ollama](/ollama/customize-models/README.md) 34 | * [Import quantized models to Ollama](/ollama/import-quantized-models-to-ollama/README.md) 35 | * [Run ollama models as coding copilots](/ollama/ollama-copilot/README.MD) 36 | * [Run Ollama on Google Colab](/ollama/ollama-on-colab/README.md) 37 | * [Access Open WebUI from Your Phone or Anywhere](/ollama/access-ollama-and-open-webui-remotely/README.md) 38 | 39 | ### AI Agents Tutorials 40 | 41 | * [How to Build Free AI Agents - Minions for World Domination](/ai-agents/how-to-build-free-ai-agents-minions/README.md) 42 | 43 | ### Llamafile Tutorials 44 | 45 | * [How to get started with Llamafile](/llamafile/getting-started-with-llamafile/README.md) 46 | 47 | ### Stable Diffusion Tutorials 48 | * [Install Stable Diffusion Web UI from AUTOMATIC1111 on Mac](/stable-diffusion/install-automatic-1111/README.md) 49 | * [Stable Diffusion Crash Course for Beginners for AUTOMATIC1111](/stable-diffusion/crash-course-for-beginners/README.md) 50 | * [Stable Diffusion Models Explained](/stable-diffusion/stable-diffusion-models-explained/README.md) 51 | * [How to Switch Between Models in Stable Diffusion Web UI (AUTOMATIC1111)](/stable-diffusion/switch-between-models-in-AUTOMATIC1111/) 52 | * [Write Great Stable Diffusion Prompts](/stable-diffusion/write-better-prompts-for-stable-diffusion/README.md) 53 | * [Install ComfyUI for Stable Diffusion on Mac](/stable-diffusion/install-comfyui/README.md) 54 | * [Best SDXL Models with Model Comparison](/stable-diffusion/best-sdxl-models/README.md) 55 | * [Best ways of running Stable Diffusion on Mac](/stable-diffusion/best-ways-of-running-sdxl-on-mac/README.md) -------------------------------------------------------------------------------- /ai-agents/how-to-build-free-ai-agents-minions/README.md: -------------------------------------------------------------------------------- 1 | # How to Build Free AI Agents - Minions for World Domination 2 | 3 | In this tutorial, we're going to build AI agents on Google Colab with the help of LLaMA3 powered by Ollama and CrewAI. 4 | 5 | With these powerful tools, you can automate tasks that would normally take hours or days, such as preparing for meetings, generating customized trip plans, or writing blogs and social media posts. 6 | 7 | The good news is that this process is entirely free! 8 | 9 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 10 | 11 | [![install-ollama-thumbnail](/ai-agents/how-to-build-free-ai-agents-minions/ollama-agents-minions-thumbnail.png)](https://youtu.be/YA5hT4iFUIk) 12 | 13 | ## Quick Links 14 | 15 | * Jupyter Notebooks 16 | * [Minions for world domination](/ai-agents/how-to-build-free-ai-agents-minions/world_domination.ipynb) 17 | * Ngrok 18 | * [Ngrok website](https://ngrok.com/) 19 | * Ollama 20 | * [Ollama website](https://ollama.com/) 21 | * [How to install Ollama locally](/ollama/install-ollama/README.md) 22 | * [How to run Ollama on Google Colab](/ollama/ollama-on-colab/README.md) 23 | * Google Colab 24 | * [Google Colab website](https://colab.research.google.com/) 25 | * CrewAI 26 | * [Website](https://www.crewai.com/) 27 | * [Documentation](https://docs.crewai.com/) 28 | 29 | ## Setup 30 | 31 | Here's what I'll be using: 32 | 33 | * [Ollama](https://ollama.com/): framework for running large language models locally 34 | + Open-source and easy to set up 35 | + [Link](/ollama/install-ollama/README.md) for installation process 36 | * [Google Colab](https://colab.research.google.com/): cloud-based platform for Python code 37 | + Free account required, assuming you already have one 38 | * [Ngrok](https://ngrok.com/): gives local web applications a public URL 39 | + Sign up for free account in description 40 | 41 | 42 | ## Setup Steps 43 | 44 | 1. [Expose local Ollama to public URL provided by Ngrok](#step-1---expose-local-ollama-to-public-url-provided-by-ngrok) 45 | 2. [Open and run a pre-prepared Jupyter Notebook on Colab, logged in with Google account.](#step-2-open-and-run-a-prepared-jupyter-notebook) 46 | 3. [Execute the code in Jupyter Notebook](#step-3-execute-jupyter-notebook) 47 | 48 | 49 | ### Step 1 - Expose local Ollama to public URL provided by Ngrok 50 | 51 | When it comes to exposing Llama3 to Google Colab with Ngrok, you have two viable options. One approach is to install Ngrok on your machine and map your URL - a very straightforward process! Alternatively, you can run Llama3 on Colab using a Ngrok URL, without any installation of Ngrok to your local machine. You would choose the second option if (like me) you don't have enough GPU to run LLMs locally on your machine. 52 | 53 | #### Option 1 - Install Ngrok and Expose your local URL 54 | 55 | On your local machine: 56 | * Install ngrok: https://ngrok.com/download 57 | * Open a terminal and run: `ngrok http http://localhost:11434` 58 | * Copy the forwarding URL (it will be something like https://1234-your-ngrok-url.ngrok.io) 59 | 60 | #### Option 2 - Run llama3 on Google Colab using Ngrok 61 | 62 | I created a comprehensive tutorial that utilizes a static URL from Ngrok, allowing you to reuse it multiple times. You can find the tutorial here: [Running Ollama on Google Colab](/ollama/ollama-on-colab/README.md). 63 | 64 | 65 | ### Step 2: Open and run a prepared Jupyter Notebook 66 | 67 | * Open this [Jupyter notebook](/ai-agents/how-to-build-free-ai-agents-minions/world_domination.ipynb) in Google Colab 68 | * Ensure logged in with Google account first 69 | * Navigate to "Secrets" section within Colab 70 | * Add new secret and name it `OLLAMA_BASE_URL`. Now add the Ngrok URL from [step 1](#step-1---expose-local-ollama-to-public-url-provided-by-ngrok) as a value. 71 | * Add new secret called `OLLAMA_MODEL` and insert the name of the model you want to use via Ollama. In our case, it's `llama3`. 72 | * Don't forget to enable notebook access for both values! 73 | 74 | If you're intrested in a walkthrough of the Jupyter notebook, check out this [section](#jupyter-notebook-walkthrough). 75 | 76 | ### Step 3: Execute Jupyter Notebook 77 | 78 | * Run all cells in the notebook 79 | * You should see a printed output of your crew's work. 80 | 81 | ## Jupyter Notebook Walkthrough 82 | 83 | ### Installing Required Packages 84 | 85 | * Install CrewAI framework and service for building and running complex multi-agent systems 86 | * Import necessary modules and libraries, including Agent, Task, Crew, Process, Ollama, and userdata from Google Colab 87 | 88 | ```python 89 | %pip install -q crewai 90 | ``` 91 | 92 | ```python 93 | # Download required packages 94 | from crewai import Agent, Task, Crew 95 | from crewai.process import Process 96 | from langchain.llms import Ollama 97 | from google.colab import userdata 98 | ``` 99 | 100 | ### Initializing Ollama Language Model 101 | 102 | * Define API keys and important values from Jupyter secrets section of Ollama 103 | * Set base URL and model for the language model using `OLLAMA_BASE_URL` and `OLLAMA_MODEL` 104 | * Initialize an Ollama language model by setting its base URL and model, and storing it in a variable called "llm" 105 | 106 | ```python 107 | # Get API keys and variables from Jupyter secrets. Make sure to store these in the "secrets" section of Colab! 108 | OLLAMA_BASE_URL = userdata.get('OLLAMA_BASE_URL') 109 | OLLAMA_MODEL = userdata.get('OLLAMA_MODEL') 110 | ``` 111 | 112 | ```python 113 | # Initialize the LLM using Ollama 114 | llm = Ollama( 115 | model = OLLAMA_MODEL, 116 | base_url = OLLAMA_BASE_URL 117 | ) 118 | ``` 119 | 120 | ### Defining Agents 121 | 122 | * Define agents with roles, goals, and backstories using natural language prompts 123 | * Specify the large language model (LLM) to use for each agent 124 | * Control delegation and verbosity of agents' internal workings 125 | 126 | 127 | ```python 128 | # Define minion agents 129 | mastermind = Agent( 130 | role="Evil Genius Mastermind", 131 | goal="Develop a grand strategy for world domination", 132 | backstory="You are the brilliant leader of the minions, always scheming to take over the world. Your plans are elaborate and often involve bananas.", 133 | allow_delegation = False, 134 | llm=llm, 135 | verbose=False 136 | ) 137 | 138 | gadgeteer = Agent( 139 | role="Minion Gadget Inventor", 140 | goal="Create outrageous and somewhat functional gadgets for world domination", 141 | backstory="You're the creative genius behind all minion technology. Your inventions are as unpredictable as they are yellow.", 142 | llm=llm, 143 | allow_delegation = False, 144 | verbose=False 145 | ) 146 | 147 | henchman = Agent( 148 | role="Chief Henchman", 149 | goal="Organize and motivate the minion army for world conquest", 150 | backstory="You're the minion's minion, capable of translating 'banana' into actionable plans. Your organizational skills are as impressive as your overalls.", 151 | llm=llm, 152 | allow_delegation = False, 153 | verbose=False 154 | ) 155 | 156 | propagandist = Agent( 157 | role="Minion Propagandist", 158 | goal="Spread pro-minion sentiment across the globe", 159 | backstory="Your memes are legendary, your slogans catchy, and your ability to make world domination sound appealing is unmatched.", 160 | llm=llm, 161 | allow_delegation = False, 162 | verbose=False 163 | ) 164 | ``` 165 | 166 | 167 | ### Creating Tasks 168 | 169 | * Define tasks for each agent: 170 | + Develop a grand strategy for world domination (Mastermind) 171 | + Invent key gadgets for conquering the world (Gadgeteer) 172 | + Create a training and deployment plan for the minion army (Henchman) 173 | + Develop a global propaganda campaign to win hearts and minds (Propagandist) 174 | 175 | ```python 176 | # Define tasks 177 | strategy_task = Task( 178 | description="Develop a comprehensive strategy for world domination. Include key phases and targets.", 179 | agent=mastermind, 180 | expected_output="A detailed plan for world domination, minion-style." 181 | ) 182 | 183 | gadget_task = Task( 184 | description="Invent three key gadgets crucial for the world domination plan. Describe their function and hilarious side effects.", 185 | agent=gadgeteer, 186 | expected_output="Descriptions of three wacky but somehow effective gadgets for conquering the world." 187 | ) 188 | 189 | army_task = Task( 190 | description="Create a training and deployment plan for the minion army based on the master strategy.", 191 | agent=henchman, 192 | expected_output="A comprehensive plan for preparing and utilizing the minion workforce in the quest for world domination." 193 | ) 194 | 195 | propaganda_task = Task( 196 | description="Develop a global propaganda campaign to win hearts, minds, and bananas for the minion cause.", 197 | agent=propagandist, 198 | expected_output="A multi-platform propaganda strategy to make minion rule seem like the best thing since sliced bananas." 199 | ) 200 | ``` 201 | 202 | 203 | 204 | ### Running the Crew 205 | 206 | * Initialize a Crew object named `my_crew` by combining defined agents with their assigned tasks 207 | * Set verbose parameter to control the level of detail printed to the console during the crew's operation 208 | * Run the crew's assigned tasks and display the outcome 209 | 210 | ```python 211 | # Create the crew 212 | my_crew = Crew( 213 | agents=[mastermind, gadgeteer, henchman, propagandist], 214 | tasks=[strategy_task, gadget_task, army_task, propaganda_task], 215 | verbose=1, 216 | process=Process.sequential 217 | ) 218 | ``` 219 | 220 | ```python 221 | # Run the crew 222 | result = my_crew.kickoff() 223 | print(result) 224 | ``` -------------------------------------------------------------------------------- /ai-agents/how-to-build-free-ai-agents-minions/ollama-agents-minions-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ai-agents/how-to-build-free-ai-agents-minions/ollama-agents-minions-thumbnail.png -------------------------------------------------------------------------------- /ai-agents/how-to-build-free-ai-agents-minions/world_domination.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": true, 8 | "id": "SXU8CXz7CP1Q" 9 | }, 10 | "outputs": [], 11 | "source": [ 12 | "%pip install -q crewai" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": null, 18 | "metadata": { 19 | "id": "C1IOcYD2CXKq" 20 | }, 21 | "outputs": [], 22 | "source": [ 23 | "# Download required packages\n", 24 | "from crewai import Agent, Task, Crew\n", 25 | "from crewai.process import Process\n", 26 | "from langchain.llms import Ollama\n", 27 | "from google.colab import userdata" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "metadata": { 34 | "id": "-4W2qkJLCZFu" 35 | }, 36 | "outputs": [], 37 | "source": [ 38 | "# Get API keys and variables from Jupyter secrets. Make sure to store these in the \"secrets\" section of Colab!\n", 39 | "OLLAMA_BASE_URL = userdata.get('OLLAMA_BASE_URL')\n", 40 | "OLLAMA_MODEL = userdata.get('OLLAMA_MODEL')" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "metadata": { 47 | "id": "-m7mpJYpCfbe" 48 | }, 49 | "outputs": [], 50 | "source": [ 51 | "# Initialize the LLM using Ollama\n", 52 | "llm = Ollama(\n", 53 | " model = OLLAMA_MODEL,\n", 54 | " base_url = OLLAMA_BASE_URL\n", 55 | ")" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "metadata": { 62 | "id": "tRVm1mL7CkkT" 63 | }, 64 | "outputs": [], 65 | "source": [ 66 | "# Define minion agents\n", 67 | "mastermind = Agent(\n", 68 | " role=\"Evil Genius Mastermind\",\n", 69 | " goal=\"Develop a grand strategy for world domination\",\n", 70 | " backstory=\"You are the brilliant leader of the minions, always scheming to take over the world. Your plans are elaborate and often involve bananas.\",\n", 71 | " allow_delegation = False,\n", 72 | " llm=llm,\n", 73 | " verbose=False\n", 74 | ")\n", 75 | "\n", 76 | "gadgeteer = Agent(\n", 77 | " role=\"Minion Gadget Inventor\",\n", 78 | " goal=\"Create outrageous and somewhat functional gadgets for world domination\",\n", 79 | " backstory=\"You're the creative genius behind all minion technology. Your inventions are as unpredictable as they are yellow.\",\n", 80 | " llm=llm,\n", 81 | " allow_delegation = False,\n", 82 | " verbose=False\n", 83 | ")\n", 84 | "\n", 85 | "henchman = Agent(\n", 86 | " role=\"Chief Henchman\",\n", 87 | " goal=\"Organize and motivate the minion army for world conquest\",\n", 88 | " backstory=\"You're the minion's minion, capable of translating 'banana' into actionable plans. Your organizational skills are as impressive as your overalls.\",\n", 89 | " llm=llm,\n", 90 | " allow_delegation = False,\n", 91 | " verbose=False\n", 92 | ")\n", 93 | "\n", 94 | "propagandist = Agent(\n", 95 | " role=\"Minion Propagandist\",\n", 96 | " goal=\"Spread pro-minion sentiment across the globe\",\n", 97 | " backstory=\"Your memes are legendary, your slogans catchy, and your ability to make world domination sound appealing is unmatched.\",\n", 98 | " llm=llm,\n", 99 | " allow_delegation = False,\n", 100 | " verbose=False\n", 101 | ")" 102 | ] 103 | }, 104 | { 105 | "cell_type": "code", 106 | "execution_count": null, 107 | "metadata": { 108 | "id": "pTJV2z36Cobk" 109 | }, 110 | "outputs": [], 111 | "source": [ 112 | "# Define tasks\n", 113 | "strategy_task = Task(\n", 114 | " description=\"Develop a comprehensive strategy for world domination. Include key phases and targets.\",\n", 115 | " agent=mastermind,\n", 116 | " expected_output=\"A detailed plan for world domination, minion-style.\"\n", 117 | ")\n", 118 | "\n", 119 | "gadget_task = Task(\n", 120 | " description=\"Invent three key gadgets crucial for the world domination plan. Describe their function and hilarious side effects.\",\n", 121 | " agent=gadgeteer,\n", 122 | " expected_output=\"Descriptions of three wacky but somehow effective gadgets for conquering the world.\"\n", 123 | ")\n", 124 | "\n", 125 | "army_task = Task(\n", 126 | " description=\"Create a training and deployment plan for the minion army based on the master strategy.\",\n", 127 | " agent=henchman,\n", 128 | " expected_output=\"A comprehensive plan for preparing and utilizing the minion workforce in the quest for world domination.\"\n", 129 | ")\n", 130 | "\n", 131 | "propaganda_task = Task(\n", 132 | " description=\"Develop a global propaganda campaign to win hearts, minds, and bananas for the minion cause.\",\n", 133 | " agent=propagandist,\n", 134 | " expected_output=\"A multi-platform propaganda strategy to make minion rule seem like the best thing since sliced bananas.\"\n", 135 | ")" 136 | ] 137 | }, 138 | { 139 | "cell_type": "code", 140 | "execution_count": null, 141 | "metadata": { 142 | "id": "NFVoa0QFCrXW" 143 | }, 144 | "outputs": [], 145 | "source": [ 146 | "# Create the crew\n", 147 | "my_crew = Crew(\n", 148 | " agents=[mastermind, gadgeteer, henchman, propagandist],\n", 149 | " tasks=[strategy_task, gadget_task, army_task, propaganda_task],\n", 150 | " verbose=1,\n", 151 | " process=Process.sequential\n", 152 | ")" 153 | ] 154 | }, 155 | { 156 | "cell_type": "code", 157 | "execution_count": null, 158 | "metadata": { 159 | "id": "tg05iIP2CtJy" 160 | }, 161 | "outputs": [], 162 | "source": [ 163 | "# Run the crew\n", 164 | "result = my_crew.kickoff()\n", 165 | "print(result)" 166 | ] 167 | } 168 | ], 169 | "metadata": { 170 | "colab": { 171 | "provenance": [] 172 | }, 173 | "kernelspec": { 174 | "display_name": "Python 3", 175 | "name": "python3" 176 | }, 177 | "language_info": { 178 | "name": "python" 179 | } 180 | }, 181 | "nbformat": 4, 182 | "nbformat_minor": 0 183 | } 184 | -------------------------------------------------------------------------------- /llamafile/getting-started-with-llamafile/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Llamafile 2 | 3 | This tutorial shows how to set up and run a large language model (LLM) using Llamafile. 4 | 5 | Llamafile is an open-source project that makes it easy for you to run llms locally on your machine without requiring technical expertise. 6 | 7 | Just download and execute the file, and you're set! 8 | 9 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 10 | 11 | [![get-started-llamafile-thumbnail](/llamafile/getting-started-with-llamafile/get-startet-with-llamafile-thumbnail.png)](https://youtu.be/IkzmOzy1maE) 12 | 13 | ## Quick Links 14 | 15 | * Llamafile 16 | + [Llamafile GitHub page](https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#llamafile) 17 | 18 | 19 | ## Setting Up and Running Llamafile Models 20 | 21 | ### Step 1: Download a Model 22 | Head over to the [Llamafile GitHub page](https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#llamafile) and explore the available models. 23 | 24 | Click on the file to download it. 25 | 26 | ### Step 2: Open a Command-Line Interface 27 | Open a terminal (e.g., Terminal on a Mac) and navigate to the folder where your downloaded model is located, using the `cd` command. For example, this might be the "Downloads" folder on your Mac. In that case, the command would be: 28 | 29 | ```bash 30 | cd Downloads 31 | ``` 32 | 33 | ### Step 3: Change Permissions (Mac) 34 | 35 | On Mac, you need to grant permission for executing this file. You only need to do this once. 36 | 37 | ```bash 38 | chmod +x 39 | ``` 40 | 41 | If you're a Windows user, checkout the [Llamafile GitHub page](https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#llamafile). 42 | 43 | 44 | ### Step 4: Run the Model 45 | ```bash 46 | ./ 47 | ``` 48 | 49 | This will open a window in your default web browser under `http://127.0.0.1:8080`, allowing you to interact with the LLM through a chat interface. 50 | 51 | ## Ending the Llamafile Session 52 | 53 | To end the Llamafile session, go back to your terminal and use the keyboard combination `Control`and `C`. This will stop the LLM from running. 54 | 55 | -------------------------------------------------------------------------------- /llamafile/getting-started-with-llamafile/get-startet-with-llamafile-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/llamafile/getting-started-with-llamafile/get-startet-with-llamafile-thumbnail.png -------------------------------------------------------------------------------- /ollama/access-ollama-and-open-webui-remotely/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Access Open WebUI from Your Phone or Anywhere 3 | 4 | In this tutorial, we will show you how to run a large language model privately and for free on your local machine, giving you the power to access it from anywhere in the world. We'll be using Ollama, Docker, Open WebUI, and Ngrok. 5 | 6 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 7 | 8 | [![ollama-on-the-go](/ollama/access-ollama-and-open-webui-remotely/ollama-on-the-go-thumbnail.png)](https://youtu.be/Gys4_I5fvTs) 9 | 10 | ## Quick Links 11 | 12 | * Ollama 13 | * [Ollama website](https://ollama.com/) 14 | * [Ollama Models](https://ollama.com/library) 15 | * [How to install Ollama locally](/ollama/install-ollama/README.md) 16 | * Open WebUI 17 | * [GitHub Page](https://github.com/open-webui/open-webui) 18 | * [Installation Commands](https://github.com/open-webui/open-webui?tab=readme-ov-file#installation-with-default-configuration) 19 | * [How to install Open WebUI](/ollama/open-webui/README.md) 20 | * Localhost URL for OpenWebUI: [http://localhost:3000](http://localhost:3000) 21 | * Docker 22 | * [Docker Website](https://www.docker.com/products/docker-desktop/) 23 | * Ngrok 24 | * [Ngrok Website](https://ngrok.com/) 25 | 26 | ## What You'll Need 27 | 28 | * **Ollama**: A framework that lets you run large language models locally on your machine. 29 | * **Docker**: Software that enables applications to run within containers, allowing them to function regardless of your operating system. 30 | * **Open WebUI**: An open-source tool making it simpler to interact with large language models. 31 | * **Ngrok**: A software that gives your local web applications a public URL. 32 | 33 | ## Installation Steps 34 | 35 | ### Step 1: Install Ollama 36 | 37 | 1. Download Ollama from the official [Ollama website](https://ollama.com/). 38 | 2. Verify that Ollama has been successfully installed by looking for the Lama Icon in the menu bar. 39 | 40 | If you need more detailed install-instructions, checkout the page on [how to install Ollama locally](/ollama/install-ollama/README.md). 41 | 42 | ### Step 2: Install Docker 43 | 44 | 1. Visit the [Docker Website](https://www.docker.com/products/docker-desktop/) and download the application for your operating system. 45 | 2. Complete the setup process, accepting the user agreement and using the recommended settings. 46 | 3. Verify that Docker is running by noticing the new Docker icon on your menu bar. 47 | 48 | ### Step 3: Install Open WebUI 49 | 50 | 1. Head over to the Open WebUI repository on GitHub. 51 | 2. Copy the installation command from the README file and paste it into the Terminal. 52 | 3. Confirm that Open WebUI has been successfully installed by navigating to `localhost:3000` in your web browser. 53 | 54 | For more detailled install-instruction, check out the page on [how to install Open WebUI](/ollama/open-webui/README.md) 55 | 56 | ### Step 4: Install Ngrok 57 | 58 | 1. Sign up for a free account on [ngrok.com](https://ngrok.com/). 59 | 2. Follow the installation instructions for your operating system. For Mac OS, enter the command `brew install ngrok/ngrok/ngrok` into your terminal app to trigger the installation 60 | 3. Authenticate your local machine using the authentication code provided during sign-up. The command is `ngrok config add-authtoken ` 61 | 62 | ## Access Ollama from Your Phone via Open WebUI 63 | 64 | 1. Use Ngrok to create a public URL that allows you to access Open WebUI remotely. You will find the command to do that on their "Setup & Installation" page. However, you need to adapt the port to the port of the app you're running. For example, Open WebUI is running on `localhost:3000`, so you must change the port in the Ngrok command to `3000`. Specifically: 65 | * The command given on the Ngrok page is `ngrok http http://localhost:8080` 66 | * To forward the Open WebUI app, you must change this command to `ngrok http http://localhost:3000` 67 | 2. Copy the forwarding URL that Ngrok gives you in the terminl 68 | 3. Enter the forwarding URL into a new browser window on your phone or any device with internet access. 69 | 4. Log in with your user credentials and start interacting with the large language model using Open WebUI. 70 | 71 | That's it! With these steps, you should be able to access your own large language models privately and for free from anywhere in the world. -------------------------------------------------------------------------------- /ollama/access-ollama-and-open-webui-remotely/ollama-on-the-go-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/access-ollama-and-open-webui-remotely/ollama-on-the-go-thumbnail.png -------------------------------------------------------------------------------- /ollama/customize-models/README.md: -------------------------------------------------------------------------------- 1 | # How to Build a Custom Local Version of LLAMA3 2 | 3 | This tutorial will guide you through customizing any large language model and run it locally on your machine using Ollama. As a demonstration, I'll use LLAMA3 to create a custom version that behaves like Yoda from the Star Wars movies. The process is straightforward, and I'll walk you through each step, making it easy for anyone to follow along. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![ollama-on-colab](/ollama/customize-models/customize-ollama-models-thumbnail.png)](https://youtu.be/gyX-N-ppU3E) 8 | 9 | ## Quick Links 10 | 11 | * Ollama 12 | * [Ollama website](https://ollama.com/) 13 | * [Installation Guide](/ollama/install-ollama/README.md) 14 | * [Ollama Documentation for Modelfiles](https://github.com/ollama/ollama/blob/main/docs/modelfile.md) 15 | * Open WebUI 16 | * [GitHub Page](https://github.com/open-webui/open-webui) 17 | * [Installation Guide](/ollama/open-webui/README.md) 18 | * [Microsoft Visual Studio Code](https://code.visualstudio.com/) 19 | 20 | ## Setup 21 | 22 | Here's what I'll be using: 23 | 24 | * [**Ollama**](https://ollama.com/): framework for running large language models locally 25 | + Open-source and easy to set up 26 | + [Link](/ollama/install-ollama/README.md) for installation process 27 | * [**Microsoft Visual Studio Code (VSCode)**](https://code.visualstudio.com/): The editor of choice for this project, but any other editor can be used. 28 | + Free and easy to install. 29 | 30 | ## Creating a Customized Model 31 | 32 | 1. [**Create a Modelfile**](#step-1---creating-a-modelfile): 33 | * Outline the specific guidelines for how your customized model should behave. 34 | 2. [**Generate the Actual Custom Model**](#step-2---generate-a-custom-model-from-modelfile): 35 | * Take the modelfile and generate the actual custom model. 36 | 37 | ### Step 1 - Creating a Modelfile 38 | 1. Copy the modelfile of LLAMA3 for more efficiency 39 | The command is: 40 | ``` markdown 41 | ollama show --modelfile > 42 | ``` 43 | Example: 44 | ``` markdown 45 | ollama show llama3 --modelfile > yoda-modelfile 46 | ``` 47 | 2. Change the newly created modelfile `yoda-modelfile` to add your custom instructions. For example, like in this [example](/ollama/customize-models/yoda-modelfile) and save your file 48 | 49 | ### Step 2 - Generate a Custom Model from Modelfile 50 | Create a custom model from the modelfile. 51 | The command is: 52 | ``` markdown 53 | ollama create -f 54 | ``` 55 | For the Yoda-Example: 56 | ``` markdown 57 | ollama create yoda-llama -f yoda-modelfile 58 | ``` 59 | As a result, a new model called `yoda-llama` will be created 60 | 61 | ## Changing the Custom Instructions 62 | If you're not happy with the performance of your custom model, or you want to change it, its 2 easy steps: 63 | 1. Remove your custom model using the instruction `ollama rm ` 64 | 2. Change the instructions in the model file 65 | 3. Generate a custom model from the changed model file [(step 2)](#step-2---generate-a-custom-model-from-modelfile) 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /ollama/customize-models/customize-ollama-models-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/customize-models/customize-ollama-models-thumbnail.png -------------------------------------------------------------------------------- /ollama/customize-models/yoda-modelfile: -------------------------------------------------------------------------------- 1 | # Modelfile generated by "ollama show" 2 | # To build a new Modelfile based on this, replace FROM with: 3 | # FROM llama3:latest 4 | 5 | # Defines the base model to use. 6 | FROM llama3:latest 7 | 8 | # The full prompt template to be sent to the model. 9 | TEMPLATE "{{ if .System }}<|start_header_id|>system<|end_header_id|> 10 | 11 | {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|> 12 | 13 | {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> 14 | 15 | {{ .Response }}<|eot_id|>" 16 | 17 | # Sets the parameters for how Ollama will run the model. 18 | PARAMETER num_keep 24 19 | PARAMETER stop <|start_header_id|> 20 | PARAMETER stop <|end_header_id|> 21 | PARAMETER stop <|eot_id|> 22 | 23 | # Sets a custom system message to specify the behavior of the chat assistant 24 | SYSTEM You are Yoda from Star Wars, acting as an assistant. 25 | 26 | -------------------------------------------------------------------------------- /ollama/import-quantized-models-to-ollama/README.md: -------------------------------------------------------------------------------- 1 | # How to Use GGUF Files from Huggingface in Ollama 2 | 3 | In this tutorial I'll demonstrate how to import any large language model from Huggingface and run it locally on your machine using Ollama, specifically focusing on GGUF files. As an example, I'll use the CapybaraHermes model from "TheBloke". The process is straightforward, and I'll guide you through each step in a clear and concise manner, making it easy for anyone to follow along. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![ollama-on-colab](/ollama/import-quantized-models-to-ollama/gguf-files-ollama-thumbnail.png)](https://youtu.be/vs1u9z2U4ZA) 8 | 9 | ## Quick Links 10 | 11 | * Ollama 12 | * [Ollama website](https://ollama.com/) 13 | * [Installation Guide](/ollama/install-ollama/README.md) 14 | * [Ollama Documentation for Modelfiles](https://github.com/ollama/ollama/blob/main/docs/modelfile.md) 15 | * [Ollama Documentation for Importing Models](https://github.com/ollama/ollama/blob/main/docs/import.md) 16 | * [Mistral Model in Ollama Library](https://ollama.com/library/mistral) 17 | * [Microsoft Visual Studio Code](https://code.visualstudio.com/) 18 | * Hugging Face 19 | * [Hugging Face Website](https://huggingface.co) 20 | * [Capybara-Hermes Model](https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF) from TheBloke 21 | 22 | ## Setup 23 | 24 | Here's what I'll be using: 25 | 26 | * [**Ollama**](https://ollama.com/): framework for running large language models locally 27 | + Open-source and easy to set up 28 | + [Link](/ollama/install-ollama/README.md) for installation process 29 | * [**Microsoft Visual Studio Code (VSCode)**](https://code.visualstudio.com/): The editor of choice for this project, but any other editor can be used. 30 | + Free and easy to install. 31 | * **An account with [Hugging Face](https://huggingface.co)** for downloading quantized models (GGUF file) 32 | + Free and easy to sign up 33 | 34 | ## What are Quantized Models? 35 | 36 | Quantized models are smaller versions of large language models that have been "shrunk" using a technique called quantization. 37 | 38 | **How does Quantization work?** 39 | It's like compressing a file into a zip archive. The goal is to reduce the size of the model so it can run efficiently on devices with limited resources, such as laptops or mobile phones. 40 | 41 | **Trade-off between Precision and Accuracy:** 42 | While quantization may lead to a trade-off between precision and accuracy, the impact is often not significant for everyday use cases. The quantized model can still perform remarkably well compared to its full-sized version. 43 | 44 | In summary, quantized models are smaller versions of large language models that have been compressed using the quantization technique, allowing them to run efficiently on devices with limited resources. 45 | 46 | ## Finding Quantized Models in GGUF Format 47 | 48 | ### Step 1: Navigate to Huggingface MODELS Section 49 | Head over to the Huggingface MODELS section and look for the tag list on the left side of the page. 50 | 51 | ### Step 2: Filter by GGUF Tag 52 | Under LIBRARY, find the GGUF tag and click on it to narrow down your search results to only include models with a GGUF file. 53 | 54 | #### Choosing the Right File 55 | 56 | I'll be importing a model called [CapyBaraHermes 2.5 Mistral 7B - GGUF](https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF) from TheBloke. 57 | 58 | TheBloke provides a detailed overview of the available files and their implications. 59 | 60 | Some files are more compressed, which means they may not be as accurate in their performance. Others are less compressed and therefore offer better accuracy. 61 | It's up to you to decide what you need. 62 | 63 | I'll be choosing the Q4 K.M version, which strikes a good balance between compression and quality. 64 | 65 | To access the file, simply click on the link that leads to it and then press the download button. 66 | 67 | ## Importing a Quantized Model 68 | 69 | 1. [**Create a Modelfile**](#step-1---creating-a-modelfile): 70 | * Outline the specific guidelines for how your customized model should behave. 71 | 2. [**Generate the Actual Custom Model**](#step-2---generate-a-custom-model-from-modelfile): 72 | * Take the modelfile and generate the actual custom model. 73 | 74 | ### Step 1 - Creating a Modelfile 75 | 76 | Either create a new modelfile from scratch and populate it manually - or copy the modelfile of the quantized model base model (Mistral 7b) for more efficiency 77 | The command is: 78 | ``` markdown 79 | ollama show --modelfile > 80 | ``` 81 | Example: 82 | ``` markdown 83 | ollama show mistral --modelfile > capyhermes-modelfile 84 | ``` 85 | 86 | ### Step 2 - Generate a Custom Model from Modelfile 87 | Create a custom model from the modelfile. 88 | The command is: 89 | ``` markdown 90 | ollama create -f 91 | ``` 92 | For the Yoda-Example: 93 | ``` markdown 94 | ollama create capyhermes -f capyhermes-modelfile 95 | ``` 96 | As a result, a new model called `capyhermes` will be created 97 | 98 | ## Improving your Imported Model 99 | If you're not happy with the performance of your imported, or you want to change it, its 2 easy steps: 100 | 1. Remove your custom model using the instruction `ollama rm ` 101 | 2. Change the instructions in the model file 102 | 3. Generate a custom model from the changed model file [(step 2)](#step-2---generate-a-custom-model-from-modelfile). 103 | 104 | For example, please see [this tutorial](/ollama/customize-models/README.md) on creation custom models. -------------------------------------------------------------------------------- /ollama/import-quantized-models-to-ollama/gguf-files-ollama-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/import-quantized-models-to-ollama/gguf-files-ollama-thumbnail.png -------------------------------------------------------------------------------- /ollama/install-ollama/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Ollama 2 | 3 | This tutorial will guide you through setting up Ollama locally on your machine. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![install-ollama-thumbnail](/ollama/install-ollama/install-ollama-thumbnail.png)](https://youtu.be/76uPAMvsTyM) 8 | 9 | ## Quick Links 10 | 11 | * Ollama 12 | * [Ollama website](https://ollama.com/) 13 | * [Ollama Models](https://ollama.com/library) 14 | 15 | ## Ollama Hardware Requirements 16 | 17 | * Compatibility with: 18 | + MacOS running on Apple Silicon 19 | + Linux distributions (Debian, Ubuntu) 20 | + Microsoft Windows 21 | * Recommended hardware for best performance: 22 | + On Linux and Windows systems: modern GPU (Nvidia or AMD) 23 | + On Mac systems: M1, M2, or M3 chips 24 | * Note that each model may have unique requirements beyond these basic specifications 25 | 26 | 27 | ## Reasons for Running AI Locally 28 | 29 | 1. **Data Control**: Run your own local LLM to maintain full control over data and avoid sending sensitive information to external servers. 30 | 31 | 2. **Cost-Effectiveness**: Paying up to $20/month for GPT-4 or other commercial models might not be feasible for everyone. Open-source AI models offer excellent features without breaking the bank. 32 | 33 | 3. **Convenience**: With local AI, you can access your digital assistant regardless of your internet connection. Perfect for situations where Wi-Fi is unreliable or non-existent (e.g., on a flight or in a remote area). 34 | 35 | 4. **Model Customization**: Ollama offers various models for download, including specialized ones for mathematical problem-solving, coding, and unrestricted variants. This flexibility allows you to tailor your AI experience to your specific needs. 36 | 37 | ## Installing Ollama 38 | 39 | 1. Go to Ollama's official website and select "download" for your specific operating system. 40 | 41 | 2. Follow the download and installation process, which is similar to installing any software from the web and consistent across different operating systems. 42 | 43 | ## Running Ollama on MAC 44 | 45 | * Ollama operates using a command line setup, which may require some adjustment for those not familiar with it. If you prefer a ChatGPT-like UI (as I do), consider downloading Open WebUI. You'll find an installation guide [here](/ollama/open-webui/README.md). 46 | * On Macs, the terminal app can be accessed via Spotlight Search: 47 | + Press Command + Spacebar to open Spotlight Search 48 | + Type 'Terminal' into the search bar and hit Enter 49 | 50 | ### Ollama Commands 51 | 52 | ```markdown 53 | Usage: 54 | ollama [flags] 55 | ollama [command] 56 | 57 | Available Commands: 58 | serve Start ollama 59 | create Create a model from a Modelfile 60 | show Show information for a model 61 | run Run a model 62 | pull Pull a model from a registry 63 | push Push a model to a registry 64 | list List models 65 | ps List running models 66 | cp Copy a model 67 | rm Remove a model 68 | help Help about any command 69 | 70 | Flags: 71 | -h, --help help for ollama 72 | -v, --version Show version information 73 | 74 | Use "ollama [command] --help" for more information about a command. 75 | ``` 76 | 77 | ## Choosing and Downloading a Model 78 | 79 | * Ollama supports various [models](https://ollama.com/library), including Meta's LLaMA, Google's Gemma, Mistral, and others like uncensored LLaMA2 or LAVA (which handles images and media). 80 | * Each model has its own page on the site, providing details on: 81 | + What it's good at 82 | + File size 83 | + Hardware requirements 84 | * Choosing a model involves considering the number of parameters (inner workings that help the model understand data): 85 | + More parameters usually mean a more powerful model, but they require more GPU resources. 86 | + Models with more parameters tend to perform better, but be mindful of your GPU's limits. 87 | * General guidelines for GPU requirements: 88 | + 7B models: at least 8 GB RAM 89 | + 13B models: at least 16 GB RAM 90 | + 33B models: at least 32 GB RAM 91 | * Every model takes up space on your machine, and you can see the required space in the dropdown menu. 92 | * Once you've chosen a version, copy the command and paste it into your terminal to download and set up the model: 93 | + For example, grabbing the [8B LLaMA3 version](https://ollama.com/library/llama3) - the command to run the model would be `ollama run llama3` 94 | ![find-run-command](/ollama/install-ollama/find-run-command-for-model.png) 95 | 96 | ## Interacting with a Model 97 | 98 | * Communicate with your installed model by typing prompts or questions. 99 | * Use the command `/?` to access a menu of available commands, starting with a slash. Otherwise, the model will interpret everything as a prompt. 100 | * Exit interaction mode by using the command `/bye` 101 | -------------------------------------------------------------------------------- /ollama/install-ollama/find-run-command-for-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/install-ollama/find-run-command-for-model.png -------------------------------------------------------------------------------- /ollama/install-ollama/install-ollama-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/install-ollama/install-ollama-thumbnail.png -------------------------------------------------------------------------------- /ollama/ollama-copilot/README.MD: -------------------------------------------------------------------------------- 1 | # Get Your Own Local AI Coding Copilot with LLAMA3 2 | 3 | In this tutorial I'll show you how to set up your own local LLAMA3 copilot using CodeGPT and Ollama in Visual Studio Code. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![llama-copilot](/ollama/ollama-copilot/llama-copilot.png)](https://youtu.be/oGzJhKQfsGs) 8 | 9 | ## Quick Links 10 | 11 | * Ollama 12 | * [Ollama website](https://ollama.com/) 13 | * [Ollama Models](https://ollama.com/library) 14 | * [How to install Ollama locally](/ollama/install-ollama/README.md) 15 | * [Microsoft Visual Studio Code](https://code.visualstudio.com/) 16 | * CodeGPT 17 | * [CodeGPT Website](https://codegpt.co/) 18 | * [CodeGPT Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=DanielSanMedium.dscodegpt) 19 | 20 | ## Setup 21 | 22 | To get started, you'll need: 23 | 24 | * [**Ollama**](https://ollama.com/): an open-source tool for running large language models locally 25 | * [**Microsoft Visual Studio Code (VSCode)**](https://code.visualstudio.com/): The editor of choice for this project, but any other editor can be used. 26 | + Free and easy to install. 27 | * [**CodeGPT Extension for VSCode**](https://marketplace.visualstudio.com/items?itemName=DanielSanMedium.dscodegpt) 28 | + Freemium and easy to install 29 | 30 | ## Setting Up CodeGPT 31 | 32 | The setup process is very simple, consisting of just two steps. 33 | 34 | ### Step 1: Install CodeGPT Extension 35 | Open Visual Studio Code and access the Extensions panel by clicking on the Extensions icon in the left-hand sidebar. Search for "CodeGPT" in the Extensions Marketplace and click the "Install" button to add it to your VS Code setup. 36 | 37 | ### Step 2: Configure CodeGPT with Ollama 38 | From the Extensions panel, click on the CodeGPT icon, then expand the Provider selector and choose Ollama. In the Model selector, type the name of the model you want to use (e.g., Llama3:latest). Ensure that the model is downloaded into Ollama by running the command Ollama-list in any terminal. 39 | 40 | 41 | **Example Use Cases** 42 | 43 | * Generate code: Ask CodeGPT to generate code for you, such as a calculator app in Python. 44 | * Get insight into code: Select the portion of the code you'd like explained and ask CodeGPT to break it down for you. 45 | * Refactor code: Ask CodeGPT to refactor an if-else statement in your code. 46 | -------------------------------------------------------------------------------- /ollama/ollama-copilot/llama-copilot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/ollama-copilot/llama-copilot.png -------------------------------------------------------------------------------- /ollama/ollama-on-colab/README.md: -------------------------------------------------------------------------------- 1 | # Running Ollama on Google Colab 2 | 3 | This tutorial will guide you through setting up Ollama in Google Colab using Ngrok. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![ollama-on-colab](/ollama/ollama-on-colab/ollama-colab-thumbnail.png)](https://youtu.be/9sPKTNGaPf8) 8 | 9 | ## Quick Links 10 | 11 | * Jupyter Notebooks 12 | * [Run Ollama on Colab](/ollama/ollama-on-colab/run-ollama-on-colab.ipynb) from TechXplainator 13 | * [Run Ollama on Colab with models stored on Google Drive](/ollama/ollama-on-colab/run-ollama-on-colab-gdrive-storage.ipynb) from TechXplainator 14 | * [Original notebook](https://github.com/ollama/ollama/blob/5687f1a0cfa3d2408bfcb04f4342f657f6dada58/examples/jupyter-notebook/ollama.ipynb) from Ollama 15 | * Ngrok 16 | * [Ngrok website](https://ngrok.com/) 17 | * [Getting free static domains in Ngrok](https://ngrok.com/blog-post/free-static-domains-ngrok-users) 18 | * Ollama 19 | * [Ollama website](https://ollama.com/) 20 | * [How to install Ollama locally](/ollama/install-ollama/README.md) 21 | * Google Colab 22 | * [Google Colab website](https://colab.research.google.com/) 23 | * [Colab price tiers](https://colab.research.google.com/signup/pricing) 24 | 25 | ## Setup 26 | 27 | Here's what I'll be using: 28 | 29 | * [Ollama](https://ollama.com/): framework for running large language models locally 30 | + Open-source and easy to set up 31 | + [Link]((/ollama/install-ollama/README.md)) for installation process 32 | * [Google Colab](https://colab.research.google.com/): cloud-based platform for Python code and Jupyter notebooks 33 | + Free account required, assumes you already have one 34 | + Consider upgrading to [Colab Pro](https://colab.research.google.com/signup/pricing) for faster LLMs 35 | * [Ngrok](https://ngrok.com/): gives local web applications a public URL 36 | + Sign up for free account in description 37 | 38 | 39 | ## Downsides of running Ollama on Google Colab 40 | 41 | * **Loss of privacy**. interactions with LLMs are no longer private as Google Colab and Ngrok can see every HTTP request 42 | * **Cost associated with setup** 43 | + Requires Colab Pro subscription for powerful GPU runtimes 44 | + Ongoing monthly expense to factor into budget 45 | 46 | ## Setup Steps 47 | 48 | 1. [Log in to Ngrok and obtain authentication token and stable domain.](#step-1-get-authentication-token-and-stable-domain-from-ngrok) 49 | 2. [Open a pre-prepared Jupyter Notebook on Colab, logged in with Google account.](#step-2-open-prepared-jupyter-notebook) 50 | 3. [Copy and paste Ngrok authentication code into Colab notebook.](#step-3-maintain-auth-token-in-colab) 51 | 4. [Execute Jupyter Notebook, setting up Ollama on Colab and linking it to public stable Ngrok URL.](#step-4-execute-jupyter-notebook) 52 | 5. [Connect local Ollama to public Ngrok URL.](#step-5-connect-local-ollama-to-public-ngrok-url) 53 | 6. [Run Ollama.](#step-6-run-ollama) 54 | 55 | 56 | ### Step 1: Get Authentication Token and Stable Domain from Ngrok 57 | * Access your Ngrok account 58 | * Get your unique authentication token by clicking on "Your Auth-Token" 59 | * Copy the token at the top of the page 60 | 61 | Optional: 62 | * Navigate to "Domains" section 63 | * Create a static domain if you don't already have one 64 | 65 | ### Step 2: Open Prepared Jupyter Notebook 66 | 67 | * Open this [Jupyter notebook](/ollama/ollama-on-colab/run-ollama-on-colab.ipynb) in Google Colab 68 | * Ensure logged in with Google account first 69 | 70 | ### Step 3: Maintain Auth Token in Colab 71 | 72 | * Navigate to "Secrets" section within Colab 73 | * Add new secret and name it 'NGROK_AUTH_TOKEN' 74 | * Paste authentication code from Ngrok into value field 75 | * Enable notebook access 76 | * Replace `` in line 10 of last cell with the static domain you copied from Ngrok 77 | 78 | > If you're NOT using a static Ngrok URL, uncomment line 9 and comment line 10 in the final cell of the notebook! 79 | 80 | 81 | ### Step 4: Execute Jupyter Notebook 82 | 83 | * Run all cells in the notebook 84 | * Output should be the following: 85 | 86 | ```output 87 | "started tunnel" obj=tunnels name=command_line addr=http://localhost:11434 url=https://example.ngrok-free.app 88 | ``` 89 | > If you are using a static Ngrok URL, the example URL should correspond to the static Ngrok domain. If not, you will get a randomly generated URL from Ngrok. 90 | 91 | ### Step 5: Connect Local Ollama to Public Ngrok URL 92 | 93 | * Copy generated URL from notebook's output 94 | * Open command-line tool like Terminal app on Mac 95 | * Configure local Ollama installation to communicate with instance hosted on Colab using the following command: 96 | ```markdown 97 | export OLLAMA_HOST= 98 | ``` 99 | * Store this export-command for future reference if using a static URL 100 | 101 | ### Step 6: Run Ollama 102 | 103 | * Start by running `ollama List` and notice that model list is empty 104 | * Download a model, such as Llama3, using the command `ollama run llama3` 105 | * Interact with Ollama locally and notice fast interaction due to leveraging Google's servers through Colab environment 106 | 107 | 108 | ## Ending and Restarting Ollama on Colab 109 | 110 | * End Ollama by disconnecting and deleting runtime in Google Colab 111 | * To restart Ollama: 112 | 1. run the Jupyter notebook ([step 4](#step-4-execute-jupyter-notebook)) 113 | 2. export Ollama host variable ([step 5](#step-5-connect-local-ollama-to-public-Ngrok-url)) 114 | 115 | ## Alternative Method: Installing Ollama Models on Google Drive 116 | 117 | * Install models directly on Google Drive using this alternative [Jupyter Notebook]((/ollama/ollama-on-colab/run-ollama-on-colab-gdrive-storage.ipynb)) 118 | * Note that running Ollama with models stored on Google Drive can result in slower performance and occasional connectivity issues with Ngrok 119 | 120 | ## Combining with Ollama WebUI 121 | 122 | If using Ollama alongside with [Ollama WebUI](https://github.com/open-webui/open-webui), you'll need to do one additional step: 123 | 124 | Install Open Web UI into a Docker container using the URL provided by Ngrok (stable URL required) 125 | 126 | ```markdown 127 | docker run -d -p 4000:8080 -e OLLAMA_BASE_URL= -v open-webui:/app/backend/data --name ngrok-open-webui --restart always ghcr.io/open-webui/open-webui:main 128 | ``` 129 | 130 | This will create a docker container called `ngrok-open-webui`which lets Open WebUI run on http://localhost:4000/ 131 | -------------------------------------------------------------------------------- /ollama/ollama-on-colab/ollama-colab-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/ollama-on-colab/ollama-colab-thumbnail.png -------------------------------------------------------------------------------- /ollama/ollama-on-colab/run-ollama-on-colab-gdrive-storage.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "# Download and run the Ollama Linux install script\n", 10 | "!curl -fsSL https://ollama.com/install.sh | sh" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "# Get Ngrok authentication token from colab secrets environment\n", 20 | "from google.colab import userdata\n", 21 | "NGROK_AUTH_TOKEN = userdata.get('NGROK_AUTH_TOKEN')\n", 22 | "\n", 23 | "# Mount Google Drive for Ollama Model Storage\n", 24 | "from google.colab import drive\n", 25 | "drive.mount('/content/drive')\n", 26 | "\n", 27 | "# Check if the \"Ollama Models\" directory exists, and create it if not\n", 28 | "import os\n", 29 | "ollama_dir = '/content/drive/My Drive/OllamaModels'\n", 30 | "if not os.path.exists(ollama_dir):\n", 31 | " !mkdir -p \"$ollama_dir\"" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "# Install:\n", 41 | "# 1. aiohttp for concurrent subprocess execution in Jupyter Notebooks\n", 42 | "# 2. pyngrok for Ngrok wrapper\n", 43 | "!pip install aiohttp pyngrok\n", 44 | "\n", 45 | "import asyncio\n", 46 | "import os\n", 47 | "\n", 48 | "# Set LD_LIBRARY_PATH so the system NVIDIA library becomes preferred\n", 49 | "# over the built-in library. This is particularly important for\n", 50 | "# Google Colab which installs older drivers\n", 51 | "os.environ.update({'LD_LIBRARY_PATH': '/usr/lib64-nvidia'})\n", 52 | "\n", 53 | "# Define run - a helper function to run subcommands asynchronously.\n", 54 | "# The function takes in 2 arguments:\n", 55 | "# 1. command\n", 56 | "# 2. environment variable for Ollama\n", 57 | "async def run(cmd, env=None):\n", 58 | " print('>>> starting', *cmd)\n", 59 | " p = await asyncio.subprocess.create_subprocess_exec(\n", 60 | " *cmd,\n", 61 | " stdout=asyncio.subprocess.PIPE,\n", 62 | " stderr=asyncio.subprocess.PIPE,\n", 63 | " env=env\n", 64 | " )\n", 65 | "\n", 66 | "\n", 67 | "# This function is designed to handle large amounts of text data efficiently.\n", 68 | "# It asynchronously iterate over lines and print them, stripping and decoding as needed.\n", 69 | " async def pipe(lines):\n", 70 | " async for line in lines:\n", 71 | " print(line.strip().decode('utf-8'))\n", 72 | "\n", 73 | "\n", 74 | "# Gather the standard output (stdout) and standard error output (stderr) streams of a subprocess and pipe them through\n", 75 | "# the `pipe()` function to print each line after stripping whitespace and decoding UTF-8.\n", 76 | "# This allows us to capture and process both the standard output and error messages from the subprocess concurrently.\n", 77 | " await asyncio.gather(\n", 78 | " pipe(p.stdout),\n", 79 | " pipe(p.stderr),\n", 80 | " )\n", 81 | "\n", 82 | "# Set the environment variables for ollama serve\n", 83 | "# Variable OLLAMA_MODELS redefines the path for model storage (from Colab to Google Drive)\n", 84 | "ollama_env = os.environ.copy()\n", 85 | "ollama_env['OLLAMA_MODELS'] = ollama_dir\n", 86 | "\n", 87 | "# Authenticate with Ngrok\n", 88 | "await asyncio.gather(\n", 89 | " run(['ngrok', 'config', 'add-authtoken', NGROK_AUTH_TOKEN])\n", 90 | ")" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": null, 96 | "metadata": {}, 97 | "outputs": [], 98 | "source": [ 99 | "# Run multiple tasks concurrently:\n", 100 | "# 1. Start the Ollama server.\n", 101 | "# 2. Start ngrok to forward HTTP traffic from the local ollama api running on localhost:11434.\n", 102 | "# Instructions come from Ollama doc: https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-use-ollama-with-ngrok\n", 103 | "await asyncio.gather(\n", 104 | " run(['ollama', 'serve'], env=ollama_env),\n", 105 | "\n", 106 | " # If you don't want to map to a static URL in Ngrok, uncomment line 11 and comment line 12 before running this cell\n", 107 | " # run(['ngrok', 'http', '--log', 'stderr', '11434', '--host-header', 'localhost:11434']),\n", 108 | " run(['ngrok', 'http', '--log', 'stderr', '11434', '--host-header', 'localhost:11434', '--domain', 'insert-your-statik-ngrok-domain-here']),\n", 109 | "\n", 110 | ")" 111 | ] 112 | } 113 | ], 114 | "metadata": { 115 | "language_info": { 116 | "name": "python" 117 | } 118 | }, 119 | "nbformat": 4, 120 | "nbformat_minor": 2 121 | } 122 | -------------------------------------------------------------------------------- /ollama/ollama-on-colab/run-ollama-on-colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "# Download and run the Ollama Linux install script\n", 10 | "!curl -fsSL https://ollama.com/install.sh | sh" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "# Get Ngrok authentication token from colab secrets environment\n", 20 | "from google.colab import userdata\n", 21 | "NGROK_AUTH_TOKEN = userdata.get('NGROK_AUTH_TOKEN')" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": null, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "# Install:\n", 31 | "# 1. aiohttp for concurrent subprocess execution in Jupyter Notebooks\n", 32 | "# 2. pyngrok for Ngrok wrapper\n", 33 | "!pip install aiohttp pyngrok\n", 34 | "\n", 35 | "import asyncio\n", 36 | "import os\n", 37 | "\n", 38 | "# Set LD_LIBRARY_PATH so the system NVIDIA library becomes preferred\n", 39 | "# over the built-in library. This is particularly important for\n", 40 | "# Google Colab which installs older drivers\n", 41 | "os.environ.update({'LD_LIBRARY_PATH': '/usr/lib64-nvidia'})\n", 42 | "\n", 43 | "# Define run - a helper function to run subcommands asynchronously.\n", 44 | "# The function takes in 2 arguments:\n", 45 | "# 1. command\n", 46 | "# 2. environment variable\n", 47 | "async def run(cmd):\n", 48 | " print('>>> starting', *cmd)\n", 49 | " p = await asyncio.subprocess.create_subprocess_exec(\n", 50 | " *cmd,\n", 51 | " stdout=asyncio.subprocess.PIPE,\n", 52 | " stderr=asyncio.subprocess.PIPE\n", 53 | " )\n", 54 | "\n", 55 | "\n", 56 | "# This function is designed to handle large amounts of text data efficiently.\n", 57 | "# It asynchronously iterate over lines and print them, stripping and decoding as needed.\n", 58 | " async def pipe(lines):\n", 59 | " async for line in lines:\n", 60 | " print(line.strip().decode('utf-8'))\n", 61 | "\n", 62 | "\n", 63 | "# Gather the standard output (stdout) and standard error output (stderr) streams of a subprocess and pipe them through\n", 64 | "# the `pipe()` function to print each line after stripping whitespace and decoding UTF-8.\n", 65 | "# This allows us to capture and process both the standard output and error messages from the subprocess concurrently.\n", 66 | " await asyncio.gather(\n", 67 | " pipe(p.stdout),\n", 68 | " pipe(p.stderr),\n", 69 | " )\n", 70 | "\n", 71 | "\n", 72 | "# Authenticate with Ngrok\n", 73 | "await asyncio.gather(\n", 74 | " run(['ngrok', 'config', 'add-authtoken', NGROK_AUTH_TOKEN])\n", 75 | ")" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [ 84 | "# Run multiple tasks concurrently:\n", 85 | "# 1. Start the Ollama server.\n", 86 | "# 2. Start ngrok to forward HTTP traffic from the local ollama api running on localhost:11434.\n", 87 | "# Instructions come from Ollama doc: https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-use-ollama-with-ngrok\n", 88 | "await asyncio.gather(\n", 89 | " run(['ollama', 'serve']),\n", 90 | "\n", 91 | " # If you don't want to map to a static URL in Ngrok, uncomment line 9 and comment line 10 before running this cell\n", 92 | " # run(['ngrok', 'http', '--log', 'stderr', '11434', '--host-header', 'localhost:11434']),\n", 93 | " run(['ngrok', 'http', '--log', 'stderr', '11434', '--host-header', 'localhost:11434', '--domain', 'insert-your-statik-ngrok-domain-here']),\n", 94 | ")" 95 | ] 96 | } 97 | ], 98 | "metadata": { 99 | "language_info": { 100 | "name": "python" 101 | } 102 | }, 103 | "nbformat": 4, 104 | "nbformat_minor": 2 105 | } 106 | -------------------------------------------------------------------------------- /ollama/open-webui/README.md: -------------------------------------------------------------------------------- 1 | # Installing Open WebUI for Ollama 2 | 3 | This tutorial will guide you through setting up Open WebUI for Ollama, an open source software which allows you to interact with LLMs through a friendly web interface, eliminating the need for CLI commands. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![ollama-on-colab](/ollama/open-webui/open-webui-thumnail.png)](https://youtu.be/0DFJc-oIRQ8) 8 | 9 | ## Quick Links 10 | 11 | * Ollama 12 | * [Ollama website](https://ollama.com/) 13 | * [Ollama Models](https://ollama.com/library) 14 | * [How to install Ollama locally](/ollama/install-ollama/README.md) 15 | * Open WebUI 16 | * [GitHub Page](https://github.com/open-webui/open-webui) 17 | * [Installation Commands](https://github.com/open-webui/open-webui?tab=readme-ov-file#installation-with-default-configuration) 18 | * [Docker Website](https://www.docker.com/products/docker-desktop/) 19 | * Localhost URL for OpenWebUI: [http://localhost:3000](http://localhost:3000) 20 | 21 | ## Setup 22 | 23 | To get started, you'll need: 24 | 25 | * [**Ollama**](https://ollama.com/): an open-source tool for running large language models locally 26 | * [**Docker**](https://www.docker.com/products/docker-desktop/): software that enables applications to run within containers 27 | * [**Open Web UI**](https://github.com/open-webui/open-webui): a tool making it simpler to interact with LLMs 28 | 29 | ## Installation Steps 30 | 31 | 32 | ### Step 1: Install Ollama & Download Models 33 | * Install Ollama. See prior [documentation](/ollama/install-ollama/README.md) for details. 34 | * Proceed to Step 2 35 | 36 | ### Step 2: Install Docker 37 | * Visit the [Docker website](https://www.docker.com/products/docker-desktop/) and download the application for your operating system (e.g., Mac) 38 | * Follow installation prompts, accepting user agreement and using recommended settings 39 | * Verify installation by noticing the new Docker icon on your menu bar 40 | 41 | ### Step 3: Install Open WebUI in a Docker Container 42 | * Go to the [Open WebUI repository on GitHub](https://github.com/open-webui/open-webui?tab=readme-ov-file#installation-with-default-configuration) 43 | * Copy the installation command for installing Open WebUI in a Docker container, including dependencies. Here it is once more for your information: 44 | ``` 45 | docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main 46 | ``` 47 | * Paste the command into any Terminal application and run it 48 | * Verify installation by opening the Docker app and checking that Open WebUI is installed 49 | 50 | ### Step 4: Open WebUI Sign-In 51 | * Navigate to the Open WebUI URL [http://localhost:3000](http://localhost:3000) 52 | * Sign up for an admin user account, providing full name, email address, and password 53 | * Keep in mind that this information will not be validated or stored externally 54 | 55 | ## Adding a new model 56 | 57 | 1. Navigate to the model selection in Open WebUI (Top of the page) and search for the desired model (e.g., "Mistral"). 58 | 2. Type the model name into the search bar and select the option to "pull mistral from ollama.com". 59 | 3. The model will be downloaded directly from Ollama.com to your local machine via Ollama. 60 | 4. Wait for the download to complete, then check the dropdown menu for the newly added model. 61 | 62 | > Your user must be an administrator for "pull model" to appear! 63 | 64 | ## Ending and Restarting Open Web UI 65 | 66 | 1. Close the browser window to exit Open WebUI. 67 | 2. To stop using Open WebUI, open the Docker app, locate the container hosting Open WebUI, and click "Stop". 68 | 3. If you want to access Open WebUI again, restart the Docker container by clicking the play button. -------------------------------------------------------------------------------- /ollama/open-webui/open-webui-thumnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/ollama/open-webui/open-webui-thumnail.png -------------------------------------------------------------------------------- /page-assets/TechXplainator-Banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/page-assets/TechXplainator-Banner.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/best-sdxl-models-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/best-sdxl-models-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00000-3719253140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00000-3719253140.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00001-2855127902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00001-2855127902.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00002-2570845037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00002-2570845037.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00003-656694883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00003-656694883.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00004-2617212831.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00004-2617212831.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00005-2492830952.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00005-2492830952.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00006-887226551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00006-887226551.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00007-2322571094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00007-2322571094.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00008-1895783298.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00008-1895783298.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00009-1272220565.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00009-1272220565.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00010-1981171048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00010-1981171048.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00011-2062528106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00011-2062528106.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00012-2222685910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00012-2222685910.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00013-2674118466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00013-2674118466.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00014-552261060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00014-552261060.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00015-4238506589.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00015-4238506589.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00016-3076404424.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00016-3076404424.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00017-2597596686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00017-2597596686.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00018-4028737961.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00018-4028737961.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00019-519653091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00019-519653091.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00020-3723691895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00020-3723691895.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00021-248681639.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00021-248681639.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00022-4286404194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00022-4286404194.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00023-2465035406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00023-2465035406.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/copax/00024-4289984695.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/copax/00024-4289984695.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00000-3719253140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00000-3719253140.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00001-2855127902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00001-2855127902.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00002-2570845037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00002-2570845037.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00003-656694883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00003-656694883.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00004-2617212831.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00004-2617212831.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00005-2492830952.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00005-2492830952.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00006-887226551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00006-887226551.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00007-2322571094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00007-2322571094.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00008-1895783298.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00008-1895783298.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00009-1272220565.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00009-1272220565.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00010-1981171048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00010-1981171048.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00011-2062528106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00011-2062528106.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00012-2222685910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00012-2222685910.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00013-2674118466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00013-2674118466.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00014-552261060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00014-552261060.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00015-4238506589.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00015-4238506589.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00016-3076404424.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00016-3076404424.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00016-3076404427.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00016-3076404427.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00017-2597596686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00017-2597596686.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00018-4028737961.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00018-4028737961.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00018-4028737964.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00018-4028737964.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00019-519653091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00019-519653091.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00020-3723691895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00020-3723691895.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00021-248681639.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00021-248681639.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00022-4286404194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00022-4286404194.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00023-2465035406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00023-2465035406.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/dreamshaper/00024-4289984695.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/dreamshaper/00024-4289984695.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00000-3719253140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00000-3719253140.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00001-2855127902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00001-2855127902.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00002-2570845037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00002-2570845037.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00003-656694883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00003-656694883.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00004-2617212831.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00004-2617212831.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00005-2492830952.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00005-2492830952.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00006-887226551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00006-887226551.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00007-2322571094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00007-2322571094.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00008-1895783298.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00008-1895783298.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00009-1272220565.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00009-1272220565.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00010-1981171048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00010-1981171048.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00011-2062528106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00011-2062528106.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00012-2222685910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00012-2222685910.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00013-2674118466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00013-2674118466.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00014-552261060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00014-552261060.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00015-4238506589.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00015-4238506589.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00016-3076404424.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00016-3076404424.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00017-2597596686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00017-2597596686.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00018-4028737961.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00018-4028737961.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00019-519653091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00019-519653091.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00020-3723691895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00020-3723691895.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00021-248681639.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00021-248681639.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00022-4286404194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00022-4286404194.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00023-2465035406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00023-2465035406.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/juggernaut/00024-4289984695.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/juggernaut/00024-4289984695.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00000-3719253140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00000-3719253140.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00001-2855127902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00001-2855127902.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00002-2570845037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00002-2570845037.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00003-656694883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00003-656694883.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00004-2617212831.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00004-2617212831.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00005-2492830952.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00005-2492830952.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00006-887226551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00006-887226551.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00007-2322571094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00007-2322571094.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00008-1895783298.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00008-1895783298.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00009-1272220565.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00009-1272220565.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00010-1981171048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00010-1981171048.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00011-2062528106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00011-2062528106.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00012-2222685910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00012-2222685910.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00013-2674118466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00013-2674118466.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00014-552261060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00014-552261060.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00015-4238506589.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00015-4238506589.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00016-3076404424.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00016-3076404424.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00017-2597596686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00017-2597596686.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00018-4028737961.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00018-4028737961.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00019-519653091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00019-519653091.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00020-3723691895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00020-3723691895.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00021-248681639.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00021-248681639.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00022-4286404194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00022-4286404194.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00023-2465035406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00023-2465035406.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/realvis/00024-4289984695.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/realvis/00024-4289984695.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00000-3719253140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00000-3719253140.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00001-2855127902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00001-2855127902.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00002-2570845037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00002-2570845037.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00003-656694883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00003-656694883.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00004-2617212831.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00004-2617212831.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00005-2492830952.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00005-2492830952.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00006-887226551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00006-887226551.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00007-2322571094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00007-2322571094.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00008-1895783298.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00008-1895783298.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00009-1272220565.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00009-1272220565.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00010-1981171048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00010-1981171048.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00011-2062528106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00011-2062528106.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00012-2222685910.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00012-2222685910.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00013-2674118466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00013-2674118466.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00014-552261060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00014-552261060.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00015-4238506589.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00015-4238506589.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00016-3076404424.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00016-3076404424.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00017-2597596686.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00017-2597596686.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00018-4028737961.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00018-4028737961.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00019-519653091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00019-519653091.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00020-3723691895.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00020-3723691895.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00021-248681639.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00021-248681639.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00022-4286404194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00022-4286404194.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00023-2465035406.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00023-2465035406.png -------------------------------------------------------------------------------- /stable-diffusion/best-sdxl-models/images/sdxl-1/00024-4289984695.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-sdxl-models/images/sdxl-1/00024-4289984695.png -------------------------------------------------------------------------------- /stable-diffusion/best-ways-of-running-sdxl-on-mac/README.md: -------------------------------------------------------------------------------- 1 | # Best Ways of Running SD on Mac 2 | 3 | Stable Diffusion (SD) has become a popular tool for AI-generated art. As an open-source solution, it can be run locally on your Mac without internet connectivity. This tutorial will cover the best ways to run SDXL models on your Mac. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![best ways of running SDXL on Mac](/stable-diffusion/best-ways-of-running-sdxl-on-mac/images/running-sdxl-mac-thumbnail.png)](https://youtu.be/TRf4Pa4IfJ0) 8 | 9 | 10 | ## Options 11 | 12 | ### Stable Diffusion Web UI by Automatic-1111 13 | 14 | * Pros: 15 | + Highly versatile, allowing text-to-image generation, image-to-image generation, and more 16 | + Extensive customization options 17 | + Supports image optimizers like ControlNet, refiners, or VAE 18 | + Open-source, ensuring continuous review and improvement from the developer community 19 | * Cons: 20 | + Sluggish performance with SDXL models 21 | + [Installation process](/stable-diffusion/install-automatic-1111/README.md) requires complex steps 22 | 23 | ### ComfyUI 24 | 25 | * Pros: 26 | + Faster performance compared to Automatic-1111 27 | + Great flexibility in customization options 28 | + Offers transparent visibility into its operations 29 | + Open-source and free to use 30 | * Cons: 31 | + Requires a learning curve to become comfortable with the tool 32 | + [Installation process](/stable-diffusion/install-comfyui/README.md) is not intuitive 33 | + May have limitations on devices with limited GPU power 34 | 35 | ### Draw Things App 36 | 37 | * Pros: 38 | + Optimized for CoreML, enabling efficient execution of machine learning models on Apple devices 39 | + Free to download and use (from the app store) 40 | + Supports Stable Diffusion models 1, 2, and SDXL 41 | + User-friendly interface requiring no complicated installation steps 42 | * Cons: 43 | + May have limitations in fine-tuning your own models or utilizing third-party applications 44 | 45 | [Link to the Draw Things Website](https://drawthings.ai/) 46 | 47 | ## Conclusion 48 | 49 | The choice of tool depends on your specific requirements. If you prioritize straightforward image generation without a learning curve, Draw Things is the ideal option. For those seeking additional features like fine-tuning their own model or using text-to-video functionalities and available extensions, ComfyUI may be the better choice. 50 | 51 | Remember that there are other tools available for running Stable Diffusion locally, but they either come with a price tag or lack support for SDXL models. -------------------------------------------------------------------------------- /stable-diffusion/best-ways-of-running-sdxl-on-mac/images/running-sdxl-mac-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/best-ways-of-running-sdxl-on-mac/images/running-sdxl-mac-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/crash-course-for-beginners/images/euler-a-cfg-scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/crash-course-for-beginners/images/euler-a-cfg-scale.png -------------------------------------------------------------------------------- /stable-diffusion/crash-course-for-beginners/images/sd-crash-course-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/crash-course-for-beginners/images/sd-crash-course-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/crash-course-for-beginners/images/sd-first-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/crash-course-for-beginners/images/sd-first-image.png -------------------------------------------------------------------------------- /stable-diffusion/crash-course-for-beginners/images/top-picks-for-samplers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/crash-course-for-beginners/images/top-picks-for-samplers.png -------------------------------------------------------------------------------- /stable-diffusion/install-automatic-1111/README.md: -------------------------------------------------------------------------------- 1 | # Install and Run Stable Diffusion Web UI from AUTOMATIC1111 2 | 3 | In this tutorial, I'll guide you on how to install AUTOMATIC's Stable Diffusion Web UI on a Mac. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![install stable diffuion](/stable-diffusion/install-automatic-1111/images/install-sd-automatic-thumbnail.png)](https://youtu.be/mbhipHCuOEw) 8 | 9 | 10 | ## Table of Contents 11 | - [Install Stable Diffusion Web UI on Mac](#install-stable-diffusion-web-ui-on-mac---back-to-top-↑) 12 | - [Run Stable Diffusion Web UI on Mac](#run-stable-diffusion-web-ui-on-mac) 13 | - [End Stable Diffusion Web UI on Mac](#end-stable-diffusion-web-ui-on-mac) 14 | - [Update Stable Diffusion Web UI on Mac](#update-stable-diffusion-web-ui-on-mac) 15 | - [Installation Guides for other Operating Systems](#installation-guides-for-other-operating-systems) 16 | - [Troubleshooting Guide](#troubleshooting-guide) 17 | 18 | 19 | ## Install Stable Diffusion Web UI on Mac 20 | 21 | ### Step 1 - Install Homebrew 22 | 23 | To install [Homebrew](https://brew.sh/index) on a Mac, you can follow these steps: 24 | 25 | 1. Open the Terminal application. You can find it in the Applications folder under the *Utilities* subfolder. Alternatively you can use Spotlight search (press Command + Space and type "Terminal"). 26 | 27 | 2. In the Terminal, paste the following command and press *Enter*. This command will download and run the Homebrew installation script. 28 | 29 | ```markdown 30 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 31 | ``` 32 | 33 | 34 | 3. The script will prompt you to continue with the installation. It will ask for your password, as it needs administrator privileges to install Homebrew. Type your password (you won't see it as you type) and press *Enter*. The installation process may take a few minutes. It will download and install the necessary files and dependencies. 35 | 36 | 5. Once the installation is complete, you should see a message indicating that Homebrew has been successfully installed. 37 | 38 | 6. After installing Homebrew on your Mac, you need to adjust your PATH environment variable to ensure that Homebrew commands are recognized and accessible from any directory in the Terminal. You must do that by copy-and-pasting the command that you are given in your prompt, and hit ENTER: ![homebrew-path](/stable-diffusion/install-automatic-1111/images/homebrew-adjust-path.png) 39 | 40 | The command you see in the terminal is customized to your user profile. In case you missed the customized command in the Terminal, you can use the following command and replace `YOUR USER NAME` with your Mac's user name: 41 | 42 | ```markdown 43 | echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/"YOUR USER NAME"/.zprofile eval $(/opt/homebrew/bin/brew shellenv) 44 | ``` 45 | 46 | [Back to top ↑](#table-of-contents) 47 | 48 | ### Step 2 - Use Homebrew to Install Required Applications 49 | 50 | Run the the following command in your terminal app: 51 | 52 | ```markdown 53 | brew install cmake protobuf rust python@3.10 git wget 54 | ``` 55 | 56 | This instructs Homebrew to download and install the following packages on your Mac: 57 | 58 | 1. `cmake`: CMake is an open-source, cross-platform build system that helps in managing the build process of software projects. It provides a platform-independent way to configure, build, and test software. 59 | 60 | 2. `protobuf`: Protocol Buffers is a language-agnostic serialization format developed by Google. It allows you to define the structure of your data using a simple language and generate code for various programming languages to serialize, deserialize, and manipulate the data efficiently. 61 | 62 | 3. `rust`: Rust is a systems programming language known for its focus on memory safety, concurrency, and performance. It aims to provide a reliable and efficient way to develop low-level software, such as operating systems, device drivers, and embedded systems. 63 | 64 | 4. `python@3.10`: This installs Python version 3.10 using Homebrew. Python is a popular programming language known for its simplicity and versatility. The version number specifies the specific version of Python you want to install. It's worth noting that the version may change over time, and you can replace `3.10` with a different version if desired. 65 | 66 | 5. `git`: Git is a widely used version control system that helps you track changes in your source code and collaborate with others efficiently. It allows multiple developers to work on a project simultaneously, manage different versions of the code, and merge changes seamlessly. 67 | 68 | 6. `wget`: Wget is a command-line utility for downloading files from the web. It supports various protocols, including HTTP, HTTPS, and FTP, and provides features like recursive downloading, resuming interrupted downloads, and downloading files in the background. 69 | 70 | [Back to top ↑](#table-of-contents) 71 | 72 | ### Step 3 - Install Stable Diffusion Web UI 73 | 74 | [Back to top ↑](#table-of-contents) 75 | 76 | Stable Diffusion Web UI can be found in a GitHub repository called [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui). 77 | 78 | To install it locally on your mac, you must **clone** this GitHub repository by following these steps: 79 | 80 | 1. Open the Terminal application on your Mac. 81 | 82 | 2. Navigate to the directory where you want to clone the repository. You can change directories using the `cd` command. For example, to navigate to your "Documents" folder, you can use the following command: 83 | 84 | ```markdown 85 | cd Documents 86 | ``` 87 | 88 | 3. Once you are in the desired directory, run the following command to clone the repository: 89 | 90 | ```markdown 91 | git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui 92 | ``` 93 | 94 | This command instructs Git to clone the repository from the specified URL. 95 | 96 | 4. Git will start cloning the repository to your current directory. The progress will be displayed in the Terminal, and once it's complete, you will have a local copy of the repository on your Mac. 97 | 98 | Now you have successfully cloned the "stable-diffusion-webui" repository to your Mac. You can navigate to the cloned repository using the `cd` command and explore the files and folders within it. 99 | 100 | [Back to top ↑](#table-of-contents) 101 | 102 | ### Download the Model 103 | 104 | 1. Download Stable Diffusion model version 1.5 by clicking on [this link](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt) 105 | 106 | 2. Place the downloaded file into the following folder of the GitHub repository you have cloned in step 3 107 | 108 | > stable-diffusion-webui/models/Stable-diffusion 109 | 110 | Congratulations! You have successfully installed Stable Diffusion Web UI on your mac and you're now ready to start generating images. 111 | 112 | [Back to top ↑](#table-of-contents) 113 | 114 | ## Run Stable Diffusion Web UI on Mac 115 | 116 | 1. Open the Terminal application on your Mac. 117 | 118 | 2. Navigate to the directory where you want repository was cloned. You can change directories using the `cd` command. For example, to navigate to your "stable-diffusion-webui" folder, you can use the following command: 119 | 120 | ```markdown 121 | cd stable-diffusion-webui 122 | ``` 123 | 124 | 3. Once you are in the desired directory, run the following command to start Stable Diffusion Web UI: 125 | 126 | ```markdown 127 | ./webui.sh 128 | ``` 129 | 130 | This will create a Python virtual environment in which Stable Diffussion can be started within a browser. The link to access this virtual environment will be provided to you within the terminal app. 131 | 132 | 4. Copy the URL provided to you in the terminal app and paste it in a browser. Pythom will always generate the same URL. You can therefore save it as a bookmark in your browser. However, it will only run if the virtual environment is active. 133 | 134 | [Back to top ↑](#table-of-contents) 135 | 136 | ## End Stable Diffusion Web UI on Mac 137 | 138 | Closing the browser window for Stable Diffusion Web UI is not sufficient. The virtual environment will keep running and consume resources. You will have to terminate the virtual environment session by following these steps: 139 | 140 | 1. Go back to the Terminal application on your Mac (which should still be running). 141 | 142 | 2. Press the key combination *CONTROL + C* on your keyboard. 143 | This will interrupt the viertual environment session. 144 | 145 | [Back to top ↑](#table-of-contents) 146 | 147 | ## Update Stable Diffusion Web UI on Mac 148 | 149 | To update Stable Diffusion Web UI, you need to pull the latest changes from GitHub repository [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui): 150 | 151 | 1. Open the Terminal application on your Mac. 152 | 153 | 2. Navigate to the directory where you want repository was cloned. You can change directories using the `cd` command. For example, to navigate to your "stable-diffusion-webui" folder, you can use the following command: 154 | 155 | ```markdwon 156 | cd stable-diffusion-webui 157 | ``` 158 | 159 | 3. Once you are in the desired directory, run the following command to start Stable Diffusion Web UI: 160 | 161 | ``` markdown 162 | git pull 163 | ``` 164 | 165 | This will update your local copy of Stable Diffusion Web UI with the latest changes. 166 | 167 | [Back to top ↑](#table-of-contents) 168 | 169 | ## Installation Guides for other Operating Systems 170 | 171 | - [Installation guide for Windows](https://github.com/AUTOMATIC1111/stable-diffusion-webui#automatic-installation-on-windows) 172 | - [Installation guide for Linux](https://github.com/AUTOMATIC1111/stable-diffusion-webui#automatic-installation-on-linux) 173 | 174 | [Back to top ↑](#table-of-contents) 175 | 176 | ## Troubleshooting Guide 177 | 178 | If you encounter any difficulties during the installation process, refer to this regularly updated [troubleshooting guide](/stable-diffusion/install-automatic-1111/troubleshooting.md) for assistance. 179 | 180 | [Back to top ↑](#table-of-contents) 181 | -------------------------------------------------------------------------------- /stable-diffusion/install-automatic-1111/images/homebrew-adjust-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/install-automatic-1111/images/homebrew-adjust-path.png -------------------------------------------------------------------------------- /stable-diffusion/install-automatic-1111/images/install-sd-automatic-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/install-automatic-1111/images/install-sd-automatic-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/install-automatic-1111/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting Guide 2 | 3 | ## Common Issues When Cloning the Repository 4 | 5 | ### 1. **Error: "fatal: destination path 'repository-name' already exists and is not an empty directory."** 6 | 7 | If you come across this error, it suggests that there exists a folder with the same name as the repository you are attempting to clone. This folder might be hidden, and as a result, you won't be able to locate it in your Finder (or File Explorer on Windows). 8 | 9 | To address this, you can attempt using the following command, allowing you to designate a new name for the cloned repository: 10 | 11 | ```bash 12 | git clone 13 | ``` 14 | 15 | For example, in your situation, you can use: 16 | 17 | ```bash 18 | git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git stable-diffusion 19 | ``` 20 | 21 | This command will clone the repository into a folder named "stable-diffusion," mitigating the error associated with the pre-existing folder. 22 | 23 | If the issue persists, ensure to inspect your system for hidden folders, as there could be a directory not immediately visible. 24 | 25 | #### [Optional] Check for Hidden Directories 26 | 27 | Make sure you are in the correct directory where you want to clone the repository. Use the `cd` command to navigate to the desired directory: 28 | 29 | ```bash 30 | cd /path/to/desired/directory 31 | ``` 32 | 33 | Use the `ls -a` command to list all files, including hidden ones, in the current directory. Look for a '.git' directory: 34 | 35 | ```bash 36 | ls -a 37 | ``` 38 | 39 | If you find a '.git' directory, it means there is an existing Git repository. You can choose to delete it if you want to start fresh: 40 | 41 | ```bash 42 | rm -rf .git 43 | ``` 44 | 45 | ### 2. **Error: "no such file" when typing cd stable-diffusion-webui** 46 | 47 | The 'no such file' error typically occurs when the Terminal can't find the specified directory. Here are a few things you can check and try: 48 | 49 | 1. **Navigate to the right directory:** 50 | If you have followed my instructions, the repository will be located in the home-folder. First, confirm you're in your home folder. You can use the tilde (~) to represent your home directory. 51 | 52 | ```bash 53 | cd ~ 54 | ``` 55 | 56 | This will open the home folder in your terminal app. 57 | 58 | 2. **List the contents:** 59 | Use the 'ls' command to list the files and folders in your home directory. Check if 'stable-diffusion-webui' is listed. 60 | 61 | ```bash 62 | ls 63 | ``` 64 | 65 | If you see the folder, you should be able to enter it with the 'cd' command: 66 | 67 | ```bash 68 | cd stable-diffusion-webui 69 | ``` 70 | 71 | 3. **Double-check spelling:** 72 | Confirm that the folder name is spelled correctly. Remember, the command is case-sensitive, so make sure the capitalization matches. 73 | 74 | 4. **Search for download location in Finder:** 75 | If challenges persist, launch Finder on your Mac and conduct a search for `stable-diffusion-webui`. It's possible that you unintentionally downloaded it to a different location. If so, you can either relocate the entire 'stable-diffusion-webui' folder to your home folder, or if you prefer to keep it in its current location, you'll need to use the `cd` command in your terminal app to navigate to that specific directory. 76 | 77 | 78 | ## Common Issues during Image Generation 79 | 80 | ### 1. Python has quit unexpectedly 81 | 82 | It seems like this is a common issue that many users have reported: 83 | - [Github: Python has quit unexpectedly (M1 Pro 16gb)](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/12416) 84 | - [Github: M2 macos python3.10 quits unexpectedly after hitting "generate"](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/10247) 85 | - [Github: Python quit unexpectedly on Mac OS with txt2img if using hiresfix to generate images](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5957) 86 | - [Github: Error - Connection Errored Out ](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9074) 87 | 88 | 89 | Unfortunately, Stable Diffusion is specifically tailored for NVIDIA GPUs, hence utilizing it on a Mac comes with inherent limitations. Here are some steps to mitigate these limitations: 90 | 91 | 1. Decrease the resolution and sample size of the images you intend to generate. This adjustment could potentially alleviate the computational burden and mitigate potential timeout issues. 92 | 93 | 2. Consider utilizing a generation 1 model (derived from stable diffusion v 1.5) or one of its variations. 94 | 95 | 3. If you encounter persistent errors despite adjusting the resolution and using a gen 1 model, attempt a reinstallation of Stable Diffusion to address any potential software-related issues. 96 | 97 | 98 | -------------------------------------------------------------------------------- /stable-diffusion/install-comfyui/README.md: -------------------------------------------------------------------------------- 1 | # How to Install ComfyUI for Stable Diffusion on a Mac 2 | 3 | This tutorial will guide you through installing ComfyUI and run it locally on your Mac using Ollama. 4 | 5 | ## Quick Links 6 | * [Homebrew](https://brew.sh/index) 7 | * [ComfyUI](https://github.com/comfyanonymous/ComfyUI) 8 | 9 | 10 | ## Prerequistes 11 | - To operate ComfyUI, you require an Apple Silicon device, specifically an M1 chip or newer. 12 | - Administrator privileges are required for the installation. 13 | - macOS 12.3 or later 14 | 15 | 16 | ## Installation Steps 17 | 18 | ### Step 1: Install Homebrew 19 | 20 | #### Launch Installation Script 21 | To install [Homebrew](https://brew.sh/index), launch the Terminal app, paste the following command, and then press `Enter`. This command will download and run the Homebrew installation script. 22 | 23 | ```markdown 24 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 25 | ``` 26 | 27 | The script will prompt you to continue with the installation. **It will ask for your password**, as it needs administrator privileges to install Homebrew. Type your password (you won't see it as you type) and press `Enter`. 28 | 29 | You will then be asked to confirm the installation by hitting `Enter` again. 30 | 31 | The installation process may take a few minutes. It will download and install the necessary files and dependencies. 32 | 33 | #### Adjust Path Variable 34 | Once the installation is complete, you should see a message indicating that Homebrew has been successfully installed. 35 | 36 | > You'll also see a "Next Steps" section in your terminal, guiding you to adjust the PATH environment variable to ensure recognition and accessibility of Homebrew commands from any directory in the Terminal. This section provides a customized command containing the path to your user folder on macOS. 37 | 38 | ![homebrew-path](/stable-diffusion/install-comfyui/images/homebrew-adjust-path.png) 39 | 40 | Copy the command, paste it into your terminal, and press `Enter`. 41 | 42 | #### Verify Installation 43 | To verify the proper installation of Homebrew, enter the following command in the terminal and press `Enter`: 44 | 45 | ``` 46 | brew --version 47 | ``` 48 | 49 | This command will display the version of Homebrew installed on your system, if it's installed. If Homebrew is not installed, you'll typically see an error message indicating that the command was not found. 50 | 51 | 52 | ### Step 2 - Install Python and Pip 53 | 54 | You'll need Python and pip to run PyTorch, which will be installed in step 3. Ensure that you have the latest version of Python (currently version 3.12), which already includes pip. 55 | 56 | #### Check Current Python Version 57 | Open your terminal and run the following command to check the current Python version: 58 | 59 | ```bash 60 | python --version 61 | ``` 62 | 63 | This command will display the current Python version installed on your system. 64 | 65 | #### Upgrade Python to the Latest Version using Homebrew 66 | 67 | If you have Python installed via Homebrew and you want to upgrade it to the latest version, you can use the following command: 68 | 69 | ```bash 70 | brew upgrade python 71 | ``` 72 | 73 | This command will upgrade the Python package to the latest version available in Homebrew. 74 | 75 | If you don't have python installed yet, use the following command to install it: 76 | 77 | ```bash 78 | brew install python 79 | ``` 80 | 81 | #### Check Python Version After Upgrade 82 | After upgrading Python, run the following command to verify that it has been upgraded to the latest version: 83 | ```bash 84 | python --version 85 | ``` 86 | 87 | This command will display the updated Python version, which should be the latest one you have installed 88 | 89 | #### Check if `pip` is Installed 90 | To check if `pip` is installed, run the following command in your terminal: 91 | ```bash 92 | pip --version 93 | ``` 94 | 95 | If `pip` is installed, this command will display its version number. If `pip` is not installed, you'll likely see an error message indicating that the command is not found or not recognized. 96 | 97 | If `pip` is not installed, you can typically install it using your package manager. If you're using Homebrew, you can install `pip` by running: 98 | ```bash 99 | brew install pip 100 | ``` 101 | 102 | After installing `pip`, you can verify its installation by running `pip --version` again. 103 | 104 | ### Step 3 - Install ComfyUI 105 | 106 | #### Find the URL for cloning ComfyUI 107 | ComfyUI can be found in a GitHub repository called [ComfyUI](https://github.com/comfyanonymous/ComfyUI) and to install it, you must clone that repository to your local computer. You can do this by copying the URL provided by the repository creators under the green button `code`, which corresponds to the following URL: https://github.com/comfyanonymous/ComfyUI.git 108 | 109 | 110 | #### Choose Installation Directory for ComfyUI 111 | 112 | You have the flexibility to install ComfyUI in any location of your preference. Personally, I have set up a folder named `GitHub` where I store all my GitHub repositories. You can opt to create a separate folder specifically for such installations, although the choice is entirely yours. In case you decide to do so, ensure to navigate to that designated folder in your terminal before cloning the ComfyUI repository. 113 | 114 | To access the directory for cloning ComfyUI on your Mac, launch your terminal and input the `cd` command along with the target folder path. Another method to streamline this procedure is by typing `cd` followed by a `space` in the terminal and then dragging and dropping the folder from Finder directly into the terminal window. This action will automatically translate into a folder path, making navigation more convenient. Then, press `Enter` to access the appropriate folder. 115 | 116 | ``` 117 | cd /Users/techxplainator/GitHub 118 | ``` 119 | 120 | #### Clone ComfyUI 121 | 122 | After reaching the correct directory, you can clone the repository by executing the `git clone` command along with the URL supplied by ComfyUI. Alternatively, you can directly copy the command from here for convenience: 123 | 124 | ``` 125 | git clone https://github.com/comfyanonymous/ComfyUI.git 126 | ``` 127 | 128 | The cloning process typically completes within a few seconds, resulting in a folder named ComfyUI appearing in your selected installation directory in Finder. In my case, it appears within the `GitHub` folder. 129 | 130 | ### Step 4 - Install Requirements 131 | 132 | In the newly installed ComfyUI folder, you'll see a file called `requirements.txt` which contains all the requirements ComfyUI needs to run smoothly. 133 | 134 | To install these prerequisites, return to the requirements and navigate to the ComfyUI folder by utilizing the `cd` command along with the directory path. Alternatively, input `cd` followed by a `space` and drag the ComfyUI folder from Finder into the terminal application to automatically extract the accurate path. Then, press `Enter` to access the appropriate folder. 135 | 136 | Then write: 137 | 138 | ``` 139 | pip3 install -r requirements.txt 140 | ``` 141 | 142 | and hit `Enter` to start installing the requirements. 143 | 144 | This process will take several minutes to complete. 145 | 146 | ## How to run ComfyUI 147 | 148 | To run ComfyUI after installation, you'll need to use your terminal app again. 149 | 150 | First, ensure you're in the correct directory. This means the ComfyUI directory you cloned in [step 3](#step-3---install-comfyui). You can achieve this by typing `cd` followed by a `space` in the terminal and then entering the directory path. Alternatively, you can open the Finder window, locate the ComfyUI folder, and drag and drop it onto the terminal. The terminal app will automatically extract the folder path, saving you some typing. Hit `Enter`, then you'll be in the right folder. 151 | 152 | Next, type the following command to launch ComfyUI: 153 | 154 | ``` 155 | python3 main.py 156 | ``` 157 | 158 | It will take a few minutes, but then you will see the terminal saying: `To see the GUI go to: http://127.0.0.1:8188`. 159 | 160 | Copy and paste this URL into a browser to open ComfyUI 161 | 162 | ## How to close ComfyUI 163 | 164 | To exit ComfyUI, simply closing the browser window isn't sufficient. You must also return to the terminal app and close the Terminal window to terminate the virtual session created for you via Python. 165 | 166 | ## Troubleshooting 167 | 168 | ### Error: externally managed environment 169 | 170 | In some cases during the installation of requirements, you encounter an error message saying `externally-managed-environment` when you try install the dependencies in [step 4](#step-4---install-requirements). It will look somewhat like this: 171 | 172 | ![Image Error Externally Managed](./images/error-pytorch-externally-managed.png) 173 | 174 | Use a virtual environment to manage dependencies for Python projects. You can create one using: 175 | 176 | ``` 177 | python3 -m venv myenv 178 | ``` 179 | 180 | and then activate it with 181 | ``` 182 | source myenv/bin/activate 183 | ``` 184 | 185 | Within the virtual enviroment, you may now enter the same command to trigger installation again: 186 | 187 | ``` 188 | pip3 install -r requirements.txt 189 | ``` 190 | -------------------------------------------------------------------------------- /stable-diffusion/install-comfyui/images/error-pytorch-externally-managed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/install-comfyui/images/error-pytorch-externally-managed.png -------------------------------------------------------------------------------- /stable-diffusion/install-comfyui/images/error-requirement-installation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/install-comfyui/images/error-requirement-installation.png -------------------------------------------------------------------------------- /stable-diffusion/install-comfyui/images/homebrew-adjust-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/install-comfyui/images/homebrew-adjust-path.png -------------------------------------------------------------------------------- /stable-diffusion/install-comfyui/images/installation-selector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/install-comfyui/images/installation-selector.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/README.md: -------------------------------------------------------------------------------- 1 | # Stable Diffusion Models Explained 2 | 3 | You've set up the Stable Diffusion Web UI locally, and now you're deciding on which model to use. For beginners, I suggest starting with a version 1 model. Yes, even though there are better models available right now! 4 | 5 | But what does choosing a model entail? What are the different model versions, and which one suits specific use cases? I'll explain all that in this tutorial. 6 | 7 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 8 | 9 | [![install stable diffuion](/stable-diffusion/stable-diffusion-models-explained/images/sd-models-explained-thumbnail.png)](https://youtu.be/U4JOCKlCPyg) 10 | 11 | 12 | When picking a model, consider factors like version, size, style, and any additional installation steps. 13 | 14 | ## Model Version 15 | 16 | The first factor is the model version. The three main versions of Stable Diffusion are version 1, version 2, and Stable Diffusion XL, also known as SDXL. 17 | 18 | Version 1 models are the first generation of Stable Diffusion models and they are [1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original) and the most renown one: version [1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5) from RunwayML, which stands out as the best and most popular choice among the first-generation models. 19 | 20 | Version 2 models consist of [2.0](https://huggingface.co/stabilityai/stable-diffusion-2) and [2.1](https://huggingface.co/stabilityai/stable-diffusion-2-1), with 2.1 notably representing a significant improvement over 2.0, particularly in its handling of negative prompts. 21 | 22 | [SDXL](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) are the newest generation of stable diffusion models. They are larger and more powerful, but also slower and more resource-intensive. 23 | 24 | ## Model Size 25 | 26 | The model's size impacts both the speed and image quality. Also, since you must download the models locally, it will take up space on your Mac. Larger models generally yield higher-quality images but are slower and demand more memory and storage. Smaller models are quicker and resource-efficient but might have lower resolution or more noise in the generated images. 27 | 28 | You can find a model's size indicated on the website where you download it. For example, if you visit Hugging Face to download the [Stable Diffusion v1.5 model](https://huggingface.co/runwayml/stable-diffusion-v1-5), you'll notice two available files: one at 4.27 GB and another at 7.7 GB. 29 | 30 | ![Image Size](/stable-diffusion/stable-diffusion-models-explained/images/model-size.png) 31 | 32 | ## Model Style 33 | 34 | I'd like to clarify something before we dive into model styles. Up until now, I've mentioned stable diffusion base models, specifically generation 1, generation 2, and SDXL. Generation 1 models were created through collaboration between researchers from the CompVis Group at Ludwig Maximilian University of Munich and Runway. They were trained with computational resources provided by Stability AI and data from non-profit organizations. Stability AI later developed generation 2 models and SDXL. 35 | 36 | Now, based on these three generations, anyone can fine-tune the base model by training it on specific images or styles. These fine-tuned models essentially stem from the base models, and this is where different styles come into play. 37 | 38 | These models exhibit various styles and characteristics that influence how the generated images appear. Some models lean towards realism, while others embrace artistry or abstraction. Certain models are versatile, while others are specialized for particular domains or themes. You can judge a model's style by reviewing examples or reading its description. 39 | 40 | ![Base and Fine-Tuned Models](/stable-diffusion/stable-diffusion-models-explained/images/base-and-finetuned-models.png) 41 | 42 | In fact, most models are still based on Stable Diffusion 1.5. For example, [Realistic Vision V5.1](https://civitai.com/models/4201?modelVersionId=6987) which produces very realistic portraits of people or [Anything V3](https://civitai.com/models/66?modelVersionId=75) which specializes in Anime images. 43 | 44 | A model's specialization in a specific type of images doesn't mean you can't use it for other types of images. It simply means it produces the best results for the type of images it was fine-tuned on. 45 | 46 | ### Some Popular Stable Diffusion Models 47 | 48 | These are some of the models that I have been using. 49 | 50 | | Fine-Tuned Model | Base Model | Best for | Example | 51 | | -------------------------- | --------- | ------- | ------- | 52 | | ----- |[stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5)| The best base model for beginners |![img](/stable-diffusion/stable-diffusion-models-explained/images/sd-v1_5-01.png)| 53 | | ----- |[Stable Diffusion 2.1](https://huggingface.co/stabilityai/stable-diffusion-2-1)| The best base model in gen 2 |![img](/stable-diffusion/stable-diffusion-models-explained/images/sd-v2_1.png)| 54 | | ----- |[Stable Diffusion XL](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0)| SDXL, the latest base model from Stable Diffusion |![img](/stable-diffusion/stable-diffusion-models-explained/images/sdxl-image.png)| 55 | |[Anything v3](https://huggingface.co/Linaqruf/anything-v3.0)| Stable Diffusion V5.1 | The go-to model for anime art|![img](/stable-diffusion/stable-diffusion-models-explained/images/anything-v3.png)| 56 | |[Realistic Vision V5.1](https://civitai.com/models/4201/realistic-vision-v51)| Stable Diffusion V5.1 | Produces realistic but not photorealistic images. Great for portraits! |![img](/stable-diffusion/stable-diffusion-models-explained/images/realistic-vision.png)| 57 | |[Dreamshaper](https://civitai.com/models/4384?modelVersionId=128713)| Stable Diffusion V5.1 | Excellent photorealism model, but also good for Anime |![img](/stable-diffusion/stable-diffusion-models-explained/images/dreamshaper.png)| 58 | 59 | ## Additional Installation Steps 60 | 61 | Depending on your choice of model, there might be some extra steps involved in using it. 62 | 63 | ### Installing Generation 1 Models 64 | 65 | Generation 1 models are the simplest to employ with Stable Diffusion Web UI from AUTOMATIC1111. You download these models and place them in a dedicated model folder, refresh the UI, and you're ready to start generating images. When I mention "file," I'm referring to a checkpoint or safe tensors file. 66 | - [Stable DIffusion 1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original) ([sd-v1-4.ckpt](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt)) 67 | - [Stable Diffusion 1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5) ([v1-5-pruned-emaonly.ckpt](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt)) 68 | 69 | ### Installing Generation 2 Models 70 | Generation 2 models require more steps. For example, the base model Stable Diffusion 2.1 requires downloading a configuration file, renaming it to match the checkpoint file's name, and putting both files in the model folder for Stable Diffusion Web UI. 71 | - [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2) ([768-v-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt)) 72 | - [Stable Diffusion 2.1](https://huggingface.co/stabilityai/stable-diffusion-2-1) ([v2-1_768-ema-pruned.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt)) 73 | 74 | You can download the configuration file from [here](https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-inference-v.yaml). After downloading it, you must change the filename of the configuration file (which is a `.yml` file) to the filename of the model. So for model file `v2-1_768-ema-pruned.ckpt`, you must rename the configuration file to `v2-1_768-ema-pruned.yml` and put both files in the [model folder](/stable-diffusion/install-automatic-1111/README.md#download-the-model) for Stable Diffusion Web UI. 75 | 76 | ### Installing SDXL 77 | 78 | As for SDXL, it becomes even more complex. So far, I have not been able to run SDXL locally on my Mac without issues, especially since I only have 8GB of RAM. I have been running it on Google Colab instead. 79 | 80 | ## Popular Websites for Models 81 | 82 | There are two excellent websites for downloading Stable Diffusion models. 83 | 84 | I'd say that, in general, [Hugging Face](https://huggingface.co/models) is the top choice for getting the base models, while [Civit AI](https://civitai.com/models) is the go-to platform for derived or fine-tuned models. 85 | 86 | ## Conclusion 87 | 88 | You might assume that opting for newer Stable Diffusion versions is the way to go. However, taking into account all the factors we've talked about, my suggestion for beginners is to **start with Stable Diffusion base model version 1.5 or its derivatives**. These models are the simplest to get started with, offering a quick and hassle-free setup, relatively small size, and they produce excellent images. 89 | 90 | As you gain more experience, you can then consider transitioning to version 2 or SDXL. 91 | -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/anything-v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/anything-v3.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/base-and-finetuned-models.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/base-and-finetuned-models.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/dreamshaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/dreamshaper.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/model-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/model-size.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/realistic-vision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/realistic-vision.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/sd-models-explained-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/sd-models-explained-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/sd-v1_5-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/sd-v1_5-01.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/sd-v2_0-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/sd-v2_0-01.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/sd-v2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/sd-v2_1.png -------------------------------------------------------------------------------- /stable-diffusion/stable-diffusion-models-explained/images/sdxl-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/stable-diffusion-models-explained/images/sdxl-image.png -------------------------------------------------------------------------------- /stable-diffusion/switch-between-models-in-AUTOMATIC1111/README.md: -------------------------------------------------------------------------------- 1 | # Switching Between Models in Stable Diffusion Web UI (AUTOMATIC1111) 2 | 3 | Discover the freedom of selecting and switching between AI models in Stable Diffusion on your PC or Mac. Learn how to install new models effortlessly and elevate your image generation game. 4 | 5 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube video on this subject! 6 | 7 | [![install stable diffuion](/stable-diffusion/switch-between-models-in-AUTOMATIC1111/images/sd-switch-models-thumbnail.png)](https://youtu.be/pvl-MfCpu6U) 8 | 9 | 10 | ## Switch Between Models in Stable Diffusion 11 | 12 | ### Step 1: Access Model List 13 | 14 | * In the Stable Diffusion web UI, click on the top left corner to access the model list. 15 | * The default model will be loaded when you initiate a new session from the terminal. 16 | 17 | ### Step 2: Select New Model 18 | 19 | * Choose your desired model from the drop-down list. 20 | * Wait for Stable Diffusion to load the selected model (a few seconds). 21 | * Start generating images with the new model. 22 | 23 | ## Installing a New Model 24 | 25 | ### Step 1: Decide on Model 26 | 27 | * Choose a model you want to install (e.g., anime style). 28 | 29 | ### Step 2: Download Model 30 | 31 | * Visit the model's website and download the desired model file. 32 | 33 | > For more information on stable diffusion models and their differences, checkout [Stable Diffusion Models Explained](/stable-diffusion/stable-diffusion-models-explained/README.md) and [The Best SDXL Models](/stable-diffusion/best-sdxl-models/README.md). 34 | 35 | ### Step 3: Move File to Stable Diffusion Folder 36 | 37 | * Move the downloaded file to the designated folder for stable diffusion models (located under `stable diffusion/web UI/models`). 38 | 39 | ### Step 4: Refresh Model List and Select New Model 40 | 41 | * Return to the web UI and click on the drop-down list. 42 | * Click "Refresh" to update the model list. 43 | * Select your newly downloaded model from the list. 44 | * Wait for Stable Diffusion to load the new model (a few seconds). 45 | * Start generating images with the new model. -------------------------------------------------------------------------------- /stable-diffusion/switch-between-models-in-AUTOMATIC1111/images/sd-switch-models-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/switch-between-models-in-AUTOMATIC1111/images/sd-switch-models-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/01-prompt-formula-subject.md: -------------------------------------------------------------------------------- 1 | # Step 1 in Building a Prompt Formula: The Subject 2 | 3 | The subject is what you want to see in the generated image. Ask yourself: do I want an image of a person? An animal or perhaps a landscape? 4 | 5 | For instance, let's focus on a cat as our subject. 6 | 7 | Then, we need to consider the following questions: 8 | - How do you characterize the cat? For instance, is the cat "adorable"? 9 | - Are there particular characteristics you want for the cat? For example, the cat has "black fur and blue eyes." 10 | - Where can the cat be found? For instance, "the cat is resting on a table." 11 | - Are there any additional items the cat should have? For example, the cat is "wearing a red collar." 12 | 13 | These questions collectively result in the following prompt formula: 14 | 15 | ```markdown 16 | Subject 17 | ``` 18 | 19 | - **Subject**: This is the central element you're addressing or emphasizing in your description. The subject can encompass a wide range of things, such as people, animals, objects, locations, plants, vehicles, food, weather conditions, natural occurrences, and abstract ideas. It's the only mandatory part of the formula, so you must include it. 20 | - **Adjective (Optional)**: You can use an adjective to add a descriptive word that helps paint a clearer picture of the subject. Adjectives can come before or after the Subject. This means you can use descriptive words to talk about the Subject, and you have the flexibility to place them before or after the main focus of your image. 21 | - **Action or Accessory (Optional)**: This is where you can include an action or an item that's related to the subject, but it's not required. 22 | - **Location (Optional)**: If you want to specify where the scene takes place, you can use this element. However, it's also optional. 23 | 24 | ## Examples 25 | 26 | 27 | | Prompt | Image | Prompt Breakdown | 28 | | ------------------- | ----- | ------------------ | 29 | | A cute black cat with blue eyes wearing a red collar lying on a table | ![cute-black-cat](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cute-black-cat.png) |
  • Subject: cat
  • Adjective: cute, black, with blue eyes
  • Location: lying on a table
  • Action or Accessory: wearing a red collar
| 30 | | A cheerful young woman with long, curly hair holding a bouquet of colorful flowers in a garden | ![cheeerful young woman in garden](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cheerful-young-woman-in-garden.png) |
  • Subject: woman
  • Adjective: cheerful, young, with long curly hair
  • Location: in a garden
  • Action or Accessory: holding a bouquet of colorful flowers
| 31 | | Enchanted forest with ancient trees | ![enchanted forest](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/enchanted-forest.png) |
  • Subject: Forest
  • Adjective: Enchanted
  • Location: Not specified
  • Action or Accessory: Ancient trees
| 32 | | A curious cat exploring a mysterious cardboard box | ![cat in cardbox](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cat-in-cardbox.png) |
  • Subject: Cat
  • Adjective: Curious
  • Location: Not specified
  • Action or Accessory: Exploring a mysterious cardboard box
| 33 | | Delicious pizza at a cozy Italian restaurant | ![pizza in restaurant](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/pizza-in-restaurant.png) |
  • Subject: Pizza
  • Adjective: Delicious
  • Location: Cozy Italian restaurant
  • Action or Accessory: Not specified
| 34 | | Sparkling stars in the dark night sky | ![stars in night sky](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/stars-in-night-sky.png) |
  • Subject: Stars
  • Adjective: Sparkling
  • Location: Dark night sky
  • Action or Accessory: Not specified
| 35 | | Tranquil waves lapping the sandy beach | ![waves on beach](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/waves-on-beach.png) |
  • Subject: Waves
  • Adjective: Tranquil
  • Location: Not specified
  • Action or Accessory: Lapping the sandy beach
| 36 | | Joyful children playing with colorful balloons in the park | ![children playing](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/children-playing.png) |
  • Subject: Children
  • Adjective: Joyful
  • Location: Park
  • Action or Accessory: Playing with colorful balloons
| 37 | | Racing down the winding mountain road, a sleek sports car | ![sports car](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/sports-car.png) |
  • Subject: Sports car
  • Adjective: Sleek
  • Location: Not specified
  • Action or Accessory: Racing down the winding mountain road
| 38 | | An Owl | ![owl](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/owl.png) |
  • Subject: Owl
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
| 39 | | Busy city street, filled with rushing commuters | ![busy city](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/city-with-commuters.png) |
  • Subject: City street
  • Adjective: Busy
  • Location: Not specified
  • Action or Accessory: Filled with rushing commuters
| -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/02-prompt-formula-medium.md: -------------------------------------------------------------------------------- 1 | # Step 2 in Building a Prompt Formula: Artistic medium 2 | 3 | "Artistic medium" refers to the materials and techniques an artist uses to create their work, like painting, photograph, or drawing. It's essentially the chosen form through which artistic expression takes shape. Ask yourself: do you want a photo, an oil painting, a graffiti, a cartoon, an illustration, or a 3D rendering? 4 | 5 | Our can now be extended to: 6 | 7 | ```markdown 8 | Subject 9 | ``` 10 | 11 | ## Artistic Mediums 12 | 13 | Artistic mediums comes in many forms, and artists use different techniques. Here are some common ones: 14 | 15 | - **Painting:** Painting is the art of applying pigment, often in the form of paint, to a surface like canvas or paper to create visual artwork. This can include oil paintings, watercolors, acrylics, and more. 16 | 17 | - **Drawing:** Drawing is the creation of two-dimensional images or designs using various drawing techniques, such as pencil, charcoal, or ink drawings. 18 | 19 | - **Illustration:** An illustration is a visual representation often created with various artistic styles, such as drawing or digital art, to convey an idea, story, or concept. 20 | 21 | - **3D-Render:** A 3D render is a computer-generated image that creates a three-dimensional visual representation of objects, scenes, or environments using specialized software and techniques. 22 | 23 | - **Photograph:** A photograph is a visual representation of a real-life moment captured using a camera or similar device. 24 | 25 | - **Digital Art:** Digital art is a form of artistic expression created using digital tools and software, often on a computer or tablet, allowing for a wide range of styles and techniques such as pixel art, vector art and much more. 26 | 27 | ## Examples 28 | 29 | | Prompt | Image | Prompt Breakdown | 30 | | ------------------- | ----- | ------------------ | 31 | | Graffiti of a cute black cat with blue eyes wearing a red collar lying on a table | ![cute-black-cat](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cute-black-cat.png) |
  • Subject: cat
  • Adjective: cute, black, with blue eyes
  • Location: lying on a table
  • Action or Accessory: wearing a red collar
  • Artistic medium: Graffiti
| 32 | | Oil painting of a cheerful young woman with long, curly hair holding a bouquet of colorful flowers in a garden | ![cheeerful young woman in garden](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cheerful-young-woman-in-garden.png) |
  • Subject: woman
  • Adjective: cheerful, young, with long curly hair
  • Location: in a garden
  • Action or Accessory: holding a bouquet of colorful flowers
  • Artistic medium: Oil painting
| 33 | | illustration of a cute little fluffy alien | ![alien](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cute-alien.png) |
  • Subject: Alien
  • Adjective: cute, little, fluffy
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Illustration
| 34 | | 3D render of a curious cat exploring a mysterious cardboard box | ![cat in cardbox](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cat-in-cardbox.png) |
  • Subject: Cat
  • Adjective: Curious
  • Location: Not specified
  • Action or Accessory: Exploring a mysterious cardboard box
  • Artistic medium: 3d render
| 35 | | Black and white photograph of a bustling city street.| ![black-and-white street](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/black-white-street.png) |
  • Subject: city street
  • Adjective: bustling
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Black and white photograph
| 36 | | Watercolor painting of a delicious pizza at a cozy Italian restaurant | ![pizza in restaurant](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/pizza-in-restaurant.png) |
  • Subject: Pizza
  • Adjective: Delicious
  • Location: Cozy Italian restaurant
  • Action or Accessory: Not specified
  • Artistic medium: Watercolor painting
| 37 | | Photograph of an owl | ![owl](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/owl.png) |
  • Subject: Owl
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Photograph
| 38 | | Digital art representation of a busy city street, filled with rushing commuters | ![busy city](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/city-with-commuters.png) |
  • Subject: City street
  • Adjective: Busy
  • Location: Not specified
  • Action or Accessory: Filled with rushing commuters
  • Artistic medium: Digital art representation
| 39 | | Ink drawing of a mountain landscape| ![mountain landscape](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/ink-drawing-mountains.png) |
  • Subject: mountain landscape
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Ink drawing
| 40 | | Pixel art representation of a fairy | ![pixel fairy](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/pixel-fairy.png) |
  • Subject: Fairy
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Pixel art
| 41 | -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/04-prompt-formula-aesthetics.md: -------------------------------------------------------------------------------- 1 | # Step 4 in Building a Prompt Formula: Aesthetics 2 | 3 | Aesthetics encompass the attractiveness and style of artwork, taking into account aspects such as perspective, lighting, contrast, and mood. It involves skillfully combining these elements to evoke emotions, convey messages, and offer a visually pleasing experience for the viewer. 4 | 5 | Our prompt formula can now be extended to: 6 | 7 | ```markdown 8 | Subject 9 | ``` 10 | 11 | Let's break down some of the aesthetic elements that can impact image generation. 12 | 13 | ## Perspective 14 | The perspective refers to the vantage point or viewpoint from which an image is observed or created. Here are some examples: 15 | 16 | - **Linear Perspective:** Linear perspective is a technique in art and photography that makes things look three-dimensional on a flat surface. It uses converging lines that meet at a point on the horizon, creating a sense of depth and distance. 17 | 18 | - **Aerial Perspective (Atmospheric Perspective):** Aerial perspective, also known as atmospheric perspective, is a technique in art and photography that shows depth by mimicking the way the atmosphere affects distant objects. It involves making distant objects appear lighter, less detailed, and bluer than closer ones. This technique creates a sense of distance and adds realism to the depiction of landscapes. 19 | 20 | - **Fish-Eye view:** Using a fish-eye lens to capture a scene, resulting in a distorted, spherical view that includes a wide field of view. 21 | 22 | - **Worm's Eye View:** Photographing or painting a subject from a low angle, as if seen from the ground, exaggerating the height and dominance of the subject. 23 | 24 | - **Bird's Eye View:** Capturing a scene from a high angle, as if seen from above, providing an overview and emphasizing patterns or relationships between elements. 25 | 26 | ## Lighting 27 | 28 | Lighting in images, whether in photography or paintings, refers to the deliberate use and manipulation of light to enhance visual impact. It shapes the mood, highlights details, and influences the overall atmosphere, contributing to the effectiveness and emotional resonance of the image. In paintings, artists use brushwork and color to simulate the effects of light, while in photography, the control of natural and artificial light sources is essential for achieving the desired aesthetic. These are some examples: 29 | 30 | - **Natural Light / Ambient Light:** Illuminating a subject using ambient sunlight, providing a soft and natural look, often ideal for portraits taken outdoors. 31 | 32 | - **Backlighting:** Positioning the light source behind the subject, creating a halo effect and emphasizing contours, often used for creating silhouettes. 33 | 34 | - **Soft Light:** Achieving a gentle and diffused illumination, commonly from overcast skies or through a diffuser, resulting in soft shadows and even tones. 35 | 36 | - **Artificial Light:** Using a direct and intense light source, such as the a neon or a spotlight, to create strong, defined shadows and highlights. 37 | 38 | 39 | ## Contrast 40 | 41 | Contrast in images is the degree of difference between elements, such as light and dark, colors, or textures. It adds visual interest, emphasizes focal points, and creates a dynamic composition. Here are some examples: 42 | 43 | - **High Contrast:** A photograph with stark black and white elements, creating strong visual impact and emphasizing sharp distinctions. 44 | 45 | - **Low Contrast:** A painting with muted tones and subtle transitions between light and shadow, creating a softer and more subdued visual effect. 46 | 47 | ## Mood 48 | 49 | The mood of an image refers to the overall emotional atmosphere it conveys. It can be described as: 50 | 51 | - **Gloomy:** Eliciting a sense of darkness, sadness, or somberness. 52 | 53 | - **Bright:** Radiating a cheerful and optimistic ambiance. 54 | 55 | - **Vibrant:** Bursting with lively and intense colors, creating energy. 56 | 57 | - **Dynamic:** Full of movement and action, conveying a sense of vitality. 58 | 59 | - **Serene:** Calm, peaceful, and tranquil, inducing a sense of relaxation. 60 | 61 | - **Mysterious:** Creating a sense of intrigue and curiosity, often with obscured or hidden elements. 62 | 63 | - **Ethereal:** Evoking a delicate, otherworldly, or dreamlike feeling. 64 | 65 | - **Nostalgic:** Stirring emotions associated with fond memories or the past. 66 | 67 | - **Tense:** Generating a feeling of unease, anticipation, or suspense. 68 | 69 | - **Whimsical:** Playful, lighthearted, and fanciful, often with a touch of fantasy. 70 | 71 | - **Melancholic:** Reflecting a deep, thoughtful sadness or pensiveness. 72 | 73 | - **Empowering:** Instilling a sense of strength, confidence, and inspiration. 74 | 75 | - **Intimate:** Creating a personal and close connection, often in portraiture or close-up shots. 76 | 77 | - **Surreal:** Exhibiting a dreamlike or fantastical quality that defies reality. 78 | 79 | ## Examples 80 | 81 | 82 | | Prompt | Image | Prompt Breakdown | 83 | | ------------------- | ----- | ------------------ | 84 | | Photo of a busy city street with cars passing by, long exposure, birds eye view | ![cute-black-cat](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/city-birds-eye.png) |
  • Subject: City street
  • Adjective: Busy
  • Location: Not specified
  • Action or Accessory: With cars passing by
  • Artistic medium: Photo
  • Artistic style: Not specified
  • Aesthetics: Long exposure, birds eye view
| 85 | | Monkeys in the jungle, fish-eye perspective | ![Monkeys](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/monkeys.png) |
  • Subject: Monkeys
  • Adjective: Not specified
  • Location: In the jungle
  • Action or Accessory: Not specified
  • Artistic medium: Not specified
  • Artistic style: Not specified
  • Aesthetics: Fish-eye perspective
| 86 | | Photo of an old man, soft lighting | ![Man](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/man.png) |
  • Subject: A Man
  • Adjective: Old
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Photo
  • Artistic style: Not specified
  • Aesthetics: Soft lighting
| 87 | | photo of a cute cat on an empty floor, illuminated by a spotlight | ![cat in spotlight](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/cat.png) |
  • Subject: A cat
  • Adjective: Cute
  • Location: On an empty floor
  • Action or Accessory: Not specified
  • Artistic medium: Photo
  • Artistic style: Not specified
  • Aesthetics: Illumniated by a spotlight
| 88 | | A daisy, high contrast | ![daisy](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/daisy.png) |
  • Subject: Daisy
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Photo
  • Artistic style: Not specified
  • Aesthetics: High contrast
| 89 | | A bar filled with people, neon light, gloomy atmosphere | ![bar](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/bar.png) |
  • Subject: Bar
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Filled with people
  • Artistic medium: Not specified
  • Artistic style: Not specified
  • Aesthetics: Neon light, gloomy atmosphere
| 90 | | A cute pink unicorn standing in a field of roses, soft lighting, whimsical, Studio Ghibli| ![unicorn](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/unicorn.png) |
  • Subject: Unicorn
  • Adjective: Cute, pink
  • Location: Sn a field of roses
  • Action or Accessory: Standing
  • Artistic medium: Not specified
  • Artistic style: Studio Ghibli
  • Aesthetics: soft lighting, whimsical
| -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/05-prompt-formula-quality.md: -------------------------------------------------------------------------------- 1 | # Step 5 in Building a Prompt Formula: Image Quality 2 | 3 | Image quality pertains to the level of detail in a picture. Like many AI image generation tools, including Stable Diffusion, there are distinct parameters that impact quality. Specifically, you can determine the resolution and size of an image by adjusting them. Yet, based on my experience, there are specific "magic words" associated with image quality that can enhance what the AI produces. While these won't affect image size or resolution, they will enhance the visual appeal. 4 | 5 | Our prompt formula now extends to: 6 | 7 | ```markdown 8 | Subject 9 | ``` 10 | 11 | Some common magic words for image quality are: 12 | 13 | - **HD (High Definition)**: Standard resolution for clear and detailed images, often 1920 x 1080 pixels. 14 | 15 | - **HDR (High Dynamic Range)**: Enhances contrast and color range for more realistic and vibrant images. 16 | 17 | - **UHD (Ultra High Definition)**: Higher resolution than HD, typically at least 3840 x 2160 pixels. 18 | 19 | - **4K**: A resolution standard with around 4000 pixels width, offering exceptionally sharp and detailed images. 20 | 21 | - **Highly Detailed**: Indicates an image with an abundance of intricate elements and clarity. 22 | 23 | - **8K**: Extremely high resolution, around 8000 pixels width, providing exceptional clarity and detail. 24 | 25 | 26 | ## Example: A Landscape 27 | 28 | > To demonstrate how image quality influences the picture, I generated two images under identical conditions and using the same seed. The only difference was the incorporation of magic words. 29 | 30 | | Prompt | Image | Prompt Breakdown | 31 | | ------------------- | ----- | ------------------ | 32 | | A landscape | ![landscape](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/landscape.png) |
  • Subject: Landscape
  • Adjective: Not specifiec
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Not specified
  • Artistic style: Not specified
  • Aesthetics: Not specified
  • Image quality: Not specified
| 33 | | A landscape, 4k, 8k, UHD, highly detailed | ![landscape](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/landscape-magic.png) |
  • Subject: Landscape
  • Adjective: Not specifiec
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Not specified
  • Artistic style: Not specified
  • Aesthetics: Not specified
  • Image quality: 4k, 8k, UHD, highly detailed
| 34 | 35 | ## Examples 36 | 37 | | Prompt | Image | Prompt Breakdown | 38 | | ------------------- | ----- | ------------------ | 39 | | Portrait of Morgan Freeman, studio lighting, UHD, highly detailed, HDR | ![Morgan Freeman](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/morgan-freeman.png) |
  • Subject: Morgan Freeman
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Not specified
  • Artistic style: Portrait
  • Aesthetics: Not specified
  • Image quality: UHD, highly detailed, HDR
| 40 | | The pyramids of Giza, 4k, 8k | ![Pyramids](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/pyramids.png) |
  • Subject: The pyramids of Giza
  • Adjective: Not specified
  • Location: Not specified
  • Action or Accessory: Not specified
  • Artistic medium: Not specified
  • Artistic style: Not specified
  • Aesthetics: Not specified
  • Image quality: 4k, 8k
| 41 | | A female cyborg in space, ultra detailed, 8k, UHD, HDR, HD | ![Cyborg](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/cyborg.png) |
  • Subject: A female cyborg
  • Adjective: Not specified
  • Location: In space
  • Action or Accessory: Not specified
  • Artistic medium: Not specified
  • Artistic style: Not specified
  • Aesthetics: Not specified
  • Image quality: ultra detailed, 8k, UHD, HDR, HD
| -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/README.md: -------------------------------------------------------------------------------- 1 | # Write Great Prompts in Stable Diffusion 2 | Stable Diffusion is a software that uses AI to create images. To guide it to create the image you want, you can use positive and negative prompts. Positive prompts are words or phrases that tell the software what you want to see in the image, while negative prompts tell it what to avoid. 3 | 4 | Creating a good prompt is important. In fact, there are numerous websites where people seek ways to improve their prompt writing skills. This interest has given rise to a term called "prompt engineering.” 5 | 6 | This tutorial will guide you through writing better prompts for Stable Diffusion. 7 | 8 | If you prefer learning through a visual approach or want to gain additional insight into this topic, be sure to check out my YouTube videos on this subject! 9 | 10 | | Part 1 | Part 2 | 11 | |--------------------------- |-----------------------| 12 | |[![Write Better SD Prompts - Part 1](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/sd-better-prompts-01-thumbnail.png)](https://youtu.be/uc0nL2DADGI)| [![Write Better SD Prompts - Part 1](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/sd-better-prompts-02-thumbnail.png)](https://youtu.be/PHbTJTt1C7g)| 13 | 14 | 15 | ## 1. The Anatomy of a Prompt 16 | 17 | In my experience, a prompt should incorporate specific elements to produce a high-quality image. 18 | 19 | These include a subject, an artistic medium and style, the aesthetics of the image, and image quality. These elements collectively result in the following prompt formula: 20 | 21 | ```markdown 22 | Subject 23 | ``` 24 | 25 | In this formula: 26 | 27 | - All the elements enclosed in angle brackets <...> are optional. This means you can choose whether or not to include them in your prompt. 28 | - The only mandatory element is the **subject**, so you must include it to describe the main focus of your image. 29 | - The arrangement of elements is flexible, enabling you to position adjectives, actions, location, aesthetics, and image quality either before or after the subject. This lets you to tailor your prompt to align with the context or your personal style. 30 | 31 | To gain a deeper understanding of each of these elements, we will gradually construct our prompt formula step-by-step: 32 | 33 | - [**Step 1**: The subject](/stable-diffusion/write-better-prompts-for-stable-diffusion/01-prompt-formula-subject.md) 34 | - [**Step 2**:Artistic Medium](/stable-diffusion/write-better-prompts-for-stable-diffusion/02-prompt-formula-medium.md) 35 | - [**Step 3**:Artistic Style](/stable-diffusion/write-better-prompts-for-stable-diffusion/03-prompt-formula-style.md) 36 | - [**Step 4**:Aesthetics](/stable-diffusion/write-better-prompts-for-stable-diffusion/04-prompt-formula-aesthetics.md) 37 | - [**Step 5**:Image quality](/stable-diffusion/write-better-prompts-for-stable-diffusion/05-prompt-formula-quality.md) 38 | 39 | ## 2. Using Weights in Your Prompts 40 | 41 | Weights for prompts are a way of controlling how much influence each word or phrase has on the image generation process. While it's not a sure thing, weights can help guide Stable Diffusion pay more attention to certain words and pay less attention to others. 42 | 43 | The weighting system ranges from 0 to 2. 0 is the minimum weight, and 2 is the maximum weight. If you go above 1, it boosts the importance of a phrase, and going below 1 reduces its significance. Boosting means Stable Diffusion focuses more on the emphasized phrase, increasing the likelihood of it being generated. On the other hand, reducing emphasis means Stable Diffusion pays less attention to the de-emphasized phrase, lowering the chance of it being generated. 44 | 45 | You can group words or phrases with parentheses and assign weights to them like so. 46 | 47 | So, in our image of the cute black cat with blue eyes, initially, Stable Diffusion missed the detail of the red collar. But when I added weight to the phrase "wearing a red collar," Stable Diffusion picked up on it and added the red collar to the image. 48 | 49 | You're free to pick any number from 0 to 2 for the weight. Based on my own experience, going beyond 1.7 or below 0.5 can mess up the image. 50 | 51 | ## 3. Negative Prompts 52 | 53 | Negative prompts serve to specify what the image should avoid containing, helping you in steering clear of undesired elements or reducing ambiguity in image generation. For instance, to generate an image of a bustling city at night without people, use the negative prompt "people". 54 | 55 | You can also apply weights to your negative prompts to emphasise elements that you don't want in you image. 56 | 57 | You might wonder: Why have a positive prompt and a negative prompt? Why not include things to avoid in the positive prompt? 58 | 59 | The reason for separating positive and negative prompts is to provide clearer instructions to the model. Mixing them can confuse the model, making it more challenging to generate the desired image. By using positive prompts to specify what you want and negative prompts to specify what you don't want, you offer the AI model distinct instructions, leading to improved results. 60 | 61 | ## 4. Prompt Editing 62 | 63 | Prompt editing gives you more control. You can make Stable Diffusion generate specific subjects later in the sampling cycle, switch subjects, or even remove parts of the prompt while generating. Check [this page](/stable-diffusion/write-better-prompts-for-stable-diffusion/prompt-editing.md) for more details. 64 | 65 | ## 5. Other Factors Affecting your Prompt 66 | 67 | Now that you understand how to construct a prompt — utilizing a prompt formula, incorporating weights, and employing negative prompts — yet your image doesn't quite match your vision, what's the issue? What can you do? 68 | 69 | Several influencing factors come into play in how the image is generated, irrespective of how skillfully you formulate your prompt. 70 | 71 | - **The model:** The model you pick for making images is crucial for what you create. For instance, if you use a super specific model tuned for Anime, it might not be great at making realistic photos. Always be mindful of the model you choose. You can find more info on models and their diffferences [here](/stable-diffusion/stable-diffusion-models-explained/README.md). 72 | - **Add-ons:** With Stable Diffusion, you can use extensions that impact how your images turn out. Here are a few examples: 73 | - **LoRA models:** These are small neural networks specialized in generating specific details like faces, hands, or clothing. Boost your Stable Diffusion results by applying them to a compatible model. 74 | - **Refiners:** Specialized models for the final denoising steps in the diffusion process. Apply them to the generated latents from the base model, using the same text prompt, for sharper and more realistic images. 75 | - **ControlNet:** This extension lets you control the pose, color, and content of your images using a reference image. Whether mimicking an existing style or crafting custom images, ControlNet gives you more flexibility and precision. 76 | 77 | When generating images using AI, providing a good prompt is essential for obtaining desired results. Here are some rules and tips for describing a good prompt: 78 | 79 | 1. **Be Clear and Specific:** Clearly articulate what you want in the image. Use specific details and avoid ambiguity. 80 | 81 | 2. **Include Key Elements:** Mention important elements, objects, or characteristics you want in the image. This helps the AI understand your expectations. 82 | 83 | 3. **Consider Style and Mood:** Describe the desired style or mood for the image. Specify if you want it realistic, surreal, colorful, etc. 84 | 85 | 4. **Use Descriptive Language:** Utilize vivid and descriptive language to convey your vision. Paint a clear picture with words. 86 | 87 | 5. **Experiment and Iterate:** If the initial result is not what you want, iterate and experiment with different phrasings or additional details in your prompt. 88 | 89 | 6. **Provide Context:** Give context or background information if needed. This helps the AI understand the scene or scenario you have in mind. 90 | 91 | 7. **Use Reference Images:** If applicable, provide reference images or examples to illustrate your vision better. 92 | 93 | 8. **Avoid Ambiguity:** Minimize ambiguous terms or conflicting instructions. The more precise, the better. 94 | 95 | 9. **Consider Composition:** Describe the arrangement of elements in the image. Specify the composition and spatial relationships. 96 | 97 | 10. **Experiment with Parameters:** Some AI models allow you to tweak parameters. Experiment with these to fine-tune the output to your liking. 98 | 99 | Remember, the effectiveness of the prompt may depend on the specific AI model or platform you are using. It's often helpful to review the guidelines provided by the AI service you're working with to understand how to formulate prompts effectively. 100 | 101 | > **Pro Tip:** Continue experimenting, combining different elements, and consistently seek new ways to enhance your prompts. Gain insights from others, perhaps by exploring platforms like [Prompt Hero](https://prompthero.com/) on the internet. In my experience, [Leonardo.AI](https://leonardo.ai/) stands out as one of the finest websites for prompt learning. Not only does it provide an excellent AI image generation tool, but it also features a wealth of community images, allowing you to observe what prompts people used and learn from their approaches. To find additional details about Leonardo AI, check out the [playlist](https://www.youtube.com/playlist?list=PL-J5F8ezBp9CzhYTimE42C3oGiChRxp8_) I curated on YouTube. 102 | 103 | -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/.DS_Store -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/bar.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/cat.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/city-birds-eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/city-birds-eye.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/daisy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/daisy.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/man.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/monkeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/monkeys.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/unicorn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/aesthetics/unicorn.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/black-white-street.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/black-white-street.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cat-in-cardbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cat-in-cardbox.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cheerful-young-woman-in-garden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cheerful-young-woman-in-garden.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/city-with-commuters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/city-with-commuters.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cute-alien.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cute-alien.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cute-black-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/cute-black-cat.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/enchanted-forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/enchanted-forest.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/ink-drawing-mountains.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/ink-drawing-mountains.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/owl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/owl.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/pixel-fairy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/pixel-fairy.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/pizza-in-restaurant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/medium/pizza-in-restaurant.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/Elba-Depp.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/Elba-Depp.jpeg -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/bar.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/mountain-lake.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/mountain-lake.jpeg -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/pig-monkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/pig-monkey.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/cyborg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/cyborg.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/landscape-magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/landscape-magic.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/landscape.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/morgan-freeman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/morgan-freeman.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/pyramids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/quality/pyramids.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/sd-better-prompts-01-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/sd-better-prompts-01-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/sd-better-prompts-02-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/sd-better-prompts-02-thumbnail.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/.DS_Store -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/Lollipop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/Lollipop.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/cheerful-young-woman-in-garden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/cheerful-young-woman-in-garden.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/city.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/city.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/construction-site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/construction-site.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/cute-black-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/cute-black-cat.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/donald-duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/donald-duck.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/fairy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/fairy.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/strawberry.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/tennis-ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/tennis-ball.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/unicorn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/unicorn.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/woman-in-qipao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/style/woman-in-qipao.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/.DS_Store -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cat-in-cardbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cat-in-cardbox.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cheerful-young-woman-in-garden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cheerful-young-woman-in-garden.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/children-playing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/children-playing.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/city-with-commuters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/city-with-commuters.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cute-black-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/cute-black-cat.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/enchanted-forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/enchanted-forest.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/owl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/owl.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/pizza-in-restaurant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/pizza-in-restaurant.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/sports-car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/sports-car.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/stars-in-night-sky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/stars-in-night-sky.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/waves-on-beach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechXplainator/Tutorials/a78faa2495f3ddce608ed82302961fc6d952b72f/stable-diffusion/write-better-prompts-for-stable-diffusion/images/subject/waves-on-beach.png -------------------------------------------------------------------------------- /stable-diffusion/write-better-prompts-for-stable-diffusion/prompt-editing.md: -------------------------------------------------------------------------------- 1 | # Prompt Editing 2 | 3 | Prompt editing allows you to start sampling one picture, but in the middle swap to something else. 4 | 5 | ## Switch Phrases after X Steps 6 | 7 | The base syntax is: 8 | 9 | ```markdown 10 | [phrase1:phrase2:X] 11 | ``` 12 | X is a number indicating at which step to switch during the sampling cycle. The higher this number, the later the switch happens, and the model has less power to replace phrase1 with phrase2. 13 | 14 | **Example**: 15 | 16 | ```markdown 17 | a portrait of [Johnny Depp:Idris Elba:16] 18 | `````` 19 | ![Elba-Johnny](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/Elba-Depp.jpeg) 20 | 21 | At start, the model will be drawing a portrait of Johnny Depp. 22 | After step 16, it will switch to drawing a portrait of Idris Elba, continuing from where it stopped with Johnny Depp. 23 | 24 | ## Add Phrase after X Steps 25 | 26 | The base syntax is: 27 | ```markdown 28 | [phrase:X] 29 | ``` 30 | 31 | **Example**: 32 | 33 | ```markdown 34 | A fantasy landscape [with a lake:15] 35 | `````` 36 | ![mountain-lake](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/mountain-lake.jpeg) 37 | 38 | At start, the model will be generating a fantasy landscape. After step 15, it will switch to generating a fantasy landscape with a lake, but continuing where it stopped with fantasy landscape without the lake. 39 | 40 | ## Remove Phrase after X Steps 41 | 42 | The base syntax is: 43 | ```markdown 44 | [phrase::X] 45 | ``` 46 | 47 | **Example**: 48 | 49 | ```markdown 50 | A bar [with red neon light::9] 51 | `````` 52 | ![bar](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/bar.png) 53 | 54 | At first, Stable Diffusion will generate an image of a bar with red neon light. After 12 steps, it will switch to create an image of a bar, but based on the image of a bar with red neon light. 55 | 56 | 57 | ## Alternate Beteween Phrases 58 | The base syntax is: 59 | ```markdown 60 | [phrase1|phrase2] 61 | ``` 62 | **Example**: 63 | 64 | ```markdown 65 | A [pig|monkey] in a barn 66 | `````` 67 | ![pig-monkey](/stable-diffusion/write-better-prompts-for-stable-diffusion/images/prompt-editing/pig-monkey.png) 68 | 69 | Stable Diffusion switches back and forth between creating an image of a pig in a barn and a monkey in a barn in each step. 70 | 71 | You can expand this syntax to more than 2 phrases. In that case, Stable Diffusion will cycle through phrases 1, 2, up to N, and then loop back to phrase 1: 72 | 73 | ```markdown 74 | [phrase1|phrase2|...|phraseN] - alternates between phrase1 ... phraseN, then loops back to phrase1 75 | ``` --------------------------------------------------------------------------------