{"id":13456755,"url":"https://github.com/rbbrdckybk/dream-factory","last_synced_at":"2025-03-24T11:31:24.552Z","repository":{"id":60678759,"uuid":"536244334","full_name":"rbbrdckybk/dream-factory","owner":"rbbrdckybk","description":"Multi-threaded GUI manager for mass creation of AI-generated art with support for multiple GPUs.","archived":false,"fork":false,"pushed_at":"2024-08-09T06:15:46.000Z","size":22464,"stargazers_count":494,"open_issues_count":22,"forks_count":57,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-10-29T00:32:20.061Z","etag":null,"topics":["ai","ai-art","generative-art","image-generation","machine-learning","multi-gpu","multithreaded","nvidia-gpu","stable-diffusion"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbbrdckybk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["rbbrdckybk"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-09-13T17:46:42.000Z","updated_at":"2024-10-17T07:39:39.000Z","dependencies_parsed_at":"2023-10-15T18:50:34.258Z","dependency_job_id":"8c8a274b-6bff-4e6a-8aa9-85a5893122c4","html_url":"https://github.com/rbbrdckybk/dream-factory","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbbrdckybk%2Fdream-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbbrdckybk%2Fdream-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbbrdckybk%2Fdream-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbbrdckybk%2Fdream-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbbrdckybk","download_url":"https://codeload.github.com/rbbrdckybk/dream-factory/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245260870,"owners_count":20586489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-art","generative-art","image-generation","machine-learning","multi-gpu","multithreaded","nvidia-gpu","stable-diffusion"],"created_at":"2024-07-31T08:01:27.170Z","updated_at":"2025-03-24T11:31:22.754Z","avatar_url":"https://github.com/rbbrdckybk.png","language":"Python","funding_links":["https://github.com/sponsors/rbbrdckybk"],"categories":["Python","👑Stable Diffusion"],"sub_categories":["Python"],"readme":"# Dream Factory\n\n\n\nMulti-threaded GUI manager for mass creation of AI-generated art with support for multiple GPUs.\n\nThis is aimed at the user that wants to create a **lot** of AI artwork with minimal hands-on time. If you're looking for a repo that will allow you to spend hours tweaking a single image until it's perfect, [there are better options](https://github.com/AUTOMATIC1111/stable-diffusion-webui) (update 2022-12-06: Dream Factory now uses Automatic1111's repo on the backend so you'll get the best of both worlds!). If you have hundreds of prompt ideas and want to easily and quickly (well, as quickly as your GPUs can manage!) see them rendered in hundreds of different variations and/or styles, then this is for you.\n\nTo illustrate, I've had three GPUs running Dream Factory unattended virtually 24/7 for a few months — they churn out thousands of images every day! I can check on my images and make modifications to my running jobs remotely, at my convenience, via the Dream Factory web UI. Some samples (all straight out of Dream Factory other than reducing resolution to 1024x1024):  \n\u003ctable\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/01.jpg\" width=\"152\" height=\"152\" alt=\"sample image 1\" title=\"sample image 1\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/02.jpg\" width=\"152\" height=\"152\" alt=\"sample image 2\" title=\"sample image 2\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/03.jpg\" width=\"152\" height=\"152\" alt=\"sample image 3\" title=\"sample image 3\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/04.jpg\" width=\"152\" height=\"152\" alt=\"sample image 4\" title=\"sample image 4\"\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/05.jpg\" width=\"152\" height=\"152\" alt=\"sample image 5\" title=\"sample image 5\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/06.jpg\" width=\"152\" height=\"152\" alt=\"sample image 6\" title=\"sample image 6\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/07.jpg\" width=\"152\" height=\"152\" alt=\"sample image 7\" title=\"sample image 7\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/08.jpg\" width=\"152\" height=\"152\" alt=\"sample image 8\" title=\"sample image 8\"\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/09.jpg\" width=\"152\" height=\"152\" alt=\"sample image 9\" title=\"sample image 9\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/10.jpg\" width=\"152\" height=\"152\" alt=\"sample image 10\" title=\"sample image 10\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/11.jpg\" width=\"152\" height=\"152\" alt=\"sample image 11\" title=\"sample image 11\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/12.jpg\" width=\"152\" height=\"152\" alt=\"sample image 12\" title=\"sample image 12\"\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n\nSome UI screenshots:\n\u003ctable\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/screen_monitor.png\" width=\"152\" height=\"152\" alt=\"UI: status monitor\" title=\"UI: status monitor\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/screen_editor.png\" width=\"152\" height=\"152\" alt=\"UI: prompt editor\" title=\"UI: prompt editor\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/screen_gallery.png\" width=\"152\" height=\"152\" alt=\"UI: gallery\" title=\"UI: gallery\"\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cimg src=\"/images/screen_gallery_image.png\" width=\"152\" height=\"152\" alt=\"UI: image viewer\" title=\"UI: image viewer\"\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n\n# Features\n\n * Based on [Stable Diffusion](https://stability.ai/blog/stable-diffusion-public-release), with support for SD 1.4, SD 1.5, SD 2.0, SD 2.1, SDXL, and SD3.\n * Direct support for ControlNet, ADetailer, and Ultimate SD Upscale extensions.\n * Dream Factory acts as a powerful automation and management tool for the popular [Automatic1111 SD repo](https://github.com/AUTOMATIC1111/stable-diffusion-webui#features). Integration with Automatic1111's repo means Dream Factory has access to one of the most full-featured Stable Diffusion packages available.\n * Multi-threaded engine capable of simultaneous, fast management of multiple GPUs. As far as I'm aware, Dream Factory is currently one of the only Stable Diffusion options for true multi-GPU support.\n * Powerful custom prompt file format that allows you to easily define compound prompt templates. Want to quickly create thousands of prompts from a template like \"_photo of a **[adjective(s)] [animal]** as a **[profession]**, art by **[artist(s)]**, **[keyword(s)]**_\" where each bracketed section needs to be filled in with dozens (or hundreds) of different items? No problem. Maybe you want your GPUs to create every possible combination, or maybe you want combinations to be picked randomly? Your choice. Maybe you want some items to be handled with different settings? Totally doable. Prompt files can be as complex or simple as you want — you can simply paste in a list of stand-alone prompts and go, too!\n * Dream Factory can automatically add custom model trigger word(s) to your prompts. For example, if you're using [this Modern Disney Style model](https://huggingface.co/nitrosocke/mo-di-diffusion), you need to add 'modern disney style' to each of your prompts. If you use a lot of custom models, it can be difficult to always remember to do this. Let Dream Factory handle it for you!\n * All prompt and creation settings are automatically embedded into output images as EXIF metadata (including the random seed used). Never wonder how you created an image again!\n * Easy web interface. Includes a built-in prompt file editor with context-sensitive highlighting, a gallery that displays your prompts and creation settings alongside your images, and at-a-glance information about the status of completed/ongoing work. Hate web interfaces? Turn it off via a configuration file — Dream Factory can be run completely via the command line if that's your thing!\n * Remote management. Access and fully manage your Dream Factory installation from anywhere (and easily download your created images in bulk as .zip files!). Can be configured to be accessible via LAN, WAN (internet), or just locally on the computer that Dream Factory is running on. Includes very basic HTTP-based authentication for WAN access.\n * Integration with [civitai.com](https://civitai.com/) within Dream Factory's prompt editor. All of your downloaded models, LoRAs, embeddings, hypernets will display relevant information (SD version compatibility, trigger words, etc) when available from Civitai. Can be disabled via Dream Factory's config file if you're running offline.\n * Integrated optional [ESRGAN upscaling](https://github.com/xinntao/ESRGAN) with [GFPGAN face correction](https://xinntao.github.io/projects/gfpgan). \n * A special prompt file type for batch processing of existing images: automated upscaling, IPTC metadata tagging, image renaming, etc!\n * Easy setup. If you can download a file and copy \u0026 paste a few lines ([see below](https://github.com/rbbrdckybk/dream-factory/tree/main/README.md#setup)), you can get this working. Uses Anaconda so Dream Factory will happily run alongside other Stable Diffusion repos without disturbing them.\n\n# Requirements\n\nYou'll need at least one Nvidia GPU, preferably with a decent amount of VRAM. 3GB of VRAM should be enough to produce 512x512 images, but more GPU memory will allow you to create larger images (and/or create them faster).\n\nYou'll also need a working [Automatic1111 Stable Diffusion webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui#installation-and-running).\n\n# Setup\n\nThese instructions were tested on several Windows 10 desktops with a variety of modern Nvidia GPUs ranging from 8-12GB VRAM, and also on an Ubuntu Server 20.04.3 system with an old Nvidia Tesla M40 GPU (24GB VRAM).\n\n**[1]** Install [Anaconda](https://www.anaconda.com/products/individual), open the root terminal, and create a new environment (and activate it):\n```\nconda create --name dream-factory python=3.10\nconda activate dream-factory\n```\n\n**[2]** Install a couple required Python packages:\n```\nconda install -c anaconda git urllib3\n```\n\n**[3]** Clone this repository and switch to its directory:\n```\ngit clone https://github.com/rbbrdckybk/dream-factory\ncd dream-factory\n```\n\n**[4]** Run the included setup script to finish the rest of your installation automatically:\n```\npython setup.py\n```\n\n**[5]** Edit your config.txt file to specify the full path to your Automatic1111 SD installation:\n * Look for the **SD_LOCATION =** entry near the top of the file.\n * On Windows, it should look something like **SD_LOCATION = C:\\Applications\\stable-diffusion-webui** when finished, depending on where you placed Automatic1111's webui.\n * On Linux, you'll want something like **SD_LOCATION = /home/[username]/stable-diffusion-webui**, where [username] is the linux user it was installed under, assuming you kept the default install location.\n\nYou're done! Ensure that your [Automatic1111 installation works properly](https://github.com/AUTOMATIC1111/stable-diffusion-webui#installation-and-running) before attempting to test Dream Factory. Additionally, ensure that everything in the \"settings\" tab of Auto1111 is configured to your liking, as Dream Factory will automatically inherit any options you set there.\n\nOnce you've verified that you can generate individual images with your Auto1111 installation, you can perform a test to make sure Dream Factory is working by running this (again, from the main **dream-factory** folder):\n```\npython dream-factory.py --prompt_file prompts/example-standard.prompts\n```\nThis should start up the web interface with a simple example prompt file pre-loaded that your GPU(s) should start working on automatically. On the first run, several large files (~2GB total) will be downloaded automatically so it may take a few minutes before things start happening.\n\nEventually you should see images appearing in your **\\output** folder (or you can click on the \"Gallery\" link within the web UI and watch for them there). If you're getting images, everything is working properly and you can move on to the next section.\n\n## Setting up 1-click launcher on Windows (optional)\n\nIf you'd like to create an easy option to start Dream Factory, rather than dealing with launching Anaconda and/or opening a command-line window every time, you can follow these steps:\n\n**[1]** Open Windows Explorer and browse to this location, where [username] is your Windows username:\n```\nC:\\Users\\[username]\\anaconda3\\Scripts\n```\nMake a copy of the ```activate.bat``` file you find there, and name it ```activate-dream-factory.bat```.\n\n**[2]** Edit the ```activate-dream-factory.bat``` file you just created, and add these lines to the end of the file:\n```\n@CALL echo Starting Dream Factory...\n@CALL conda.bat activate dream-factory\n@CALL cd \"[full path to your Dream Factory folder]\"\n@CALL python dream-factory.py\n@CALL pause\n```\nReplace [full path to your Dream Factory folder] with the path that you installed Dream Factory in (e.g.: C:\\Users\\[your Windows username]\\dream-factory).\n\nSave the file and close it.\n\n**[3]** Place a shortcut to this file on your desktop (or wherever). Clicking it should launch Dream Factory.\n\n# Usage\n\nInstructions assume that you've completed [setup](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#setup) and verified that your installation works properly.\n\n## Startup and Basic Usage\n\nStart Dream Factory with:\n```\npython dream-factory.py\n```\nThe web UI should open automatically, if not go to http://localhost:8080 (assuming you didn't change the port in config.txt) via your browser. Your GPU(s) will automatically start initializing (each GPU will take about as long as it takes to launch auto1111 in standalone mode).\n\nBrowse to 'Control Panel' in the top nav and select one of the two example prompt files via the dropdown. Your GPU(s) should start working on whichever one you choose as soon as they're finished initializing. You can browse back to 'Status Monitor' and should see that your GPU(s) are being assigned work from the selected prompt file. If you browse to 'Gallery' in the top nav you'll see images appearing as they're completed.\n\n## Creating and Editing Prompt Files\n\nPrompt files are the heart of Dream Factory and define the work that you want your GPU(s) to do. They can be as simple or as complex as you want.\n\n### Example Prompt Files\n\nBefore we get into creating new prompt files, let's take a look at the two example prompt files that are included with Dream Factory. Start by clicking 'Prompt Editor' in the top nav, then choose 'example-standard' in the 'Choose a prompt file:' dropdown.\n\nYou should see the prompt file load into the editor. Prompt files have an optional [config] section at the top with directives that define your Stable Diffusion settings, and at least one [prompts] section that contains prompts (or sections of prompts to be combined with other [prompts] sections).\n\nThe example files contain comments that should make it fairly clear what each [config] directive does, and how the [prompts] sections will combine. See the [Command Reference](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#prompt-file-command-reference) below for help on any directives that aren't clear.\n\n### Creating a New Prompt File\n\nYou can create prompt files by using the integrated editor (click 'Prompt Editor' in the top nav, then click 'New Standard' or 'New Random' to start a new file). Prompt files will automatically be created with a skeleton containing common directives and the default settings contained in your config.txt.\n\nAfter creation, prompt files can be renamed by simply clicking on the name at the top of the editor, entering a new name, and then clicking 'Rename'.\n\nIf you'd prefer, you can also create prompt files externally using a text editor of your choice (name them with a .prompt extension and place them in your prompts folder). If you happen to use [Notepad++](https://notepad-plus-plus.org/), there is a plugin in the **dream-factory/prompts/notepad_plugin** folder that will add context-sensitive highlighting to .prompt files.\n\n### Prompt File Command Reference\n\nThese directives are valid only in the [config] section of both standard and random prompt files:\n\n * [!MODE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#mode)\n * [!DELIM](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#delim)\n\nThese directives are valid in both the [config] section of both standard and random prompt files **and** also in any [prompts] section of **standard** prompt files (!MODE = standard):\n\n * [!WIDTH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#width)\n * [!HEIGHT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#height)\n * [!HIGHRES_FIX](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_fix)\n * [!STEPS](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#steps)\n * [!SAMPLER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#sampler)\n * [!SCHEDULER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#scheduler)\n * [!SCALE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#scale)\n * [!SAMPLES](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#samples)\n * [!BATCH_SIZE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#batch_size)\n * [!INPUT_IMAGE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#input_image)\n * [!STRENGTH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#strength)\n * [!CKPT_FILE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#ckpt_file)\n * [!VAE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#vae)\n * [!NEG_PROMPT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#neg_prompt)\n * [!AUTO_INSERT_MODEL_TRIGGER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#auto_insert_model_trigger)\n * [!SEED](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#seed)\n * [!USE_UPSCALE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#use_upscale)\n * [!UPSCALE_MODEL](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_model)\n * [!UPSCALE_AMOUNT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_amount)\n * [!UPSCALE_CODEFORMER_AMOUNT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_codeformer_amount)\n * [!UPSCALE_GFPGAN_AMOUNT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_gfpgan_amount)\n * [!UPSCALE_KEEP_ORG](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_keep_org)\n * [!FILENAME](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#filename)\n * [!CONTROLNET_INPUT_IMAGE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_input_image)\n * [!CONTROLNET_MODEL](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_model)\n * [!CONTROLNET_PRE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_pre)\n * [!CONTROLNET_GUESSMODE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_guessmode)\n * [!CONTROLNET_CONTROLMODE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_controlmode)\n * [!CONTROLNET_PIXELPERFECT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_pixelperfect)\n * [!CONTROLNET_LOWVRAM](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_lowvram)\n * [!CONTROLNET_WEIGHT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#controlnet_weight)\n * [!AUTO_SIZE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#auto_size)\n * [!CLIP_SKIP](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#clip_skip)\n * [!SEAMLESS_TILING](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#seamless_tiling)\n * [!IPTC_TITLE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#iptc_title)\n * [!IPTC_DESCRIPTION](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#iptc_description)\n * [!IPTC_KEYWORDS](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#iptc_keywords)\n * [!IPTC_COPYRIGHT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#iptc_copyright)\n * [!STYLES](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#styles)\n * [!HIGHRES_SCALE_FACTOR](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_scale_factor)\n * [!HIGHRES_UPSCALER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_upscaler)\n * [!HIGHRES_CKPT_FILE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_ckpt_file)\n * [!HIGHRES_VAE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_vae)\n * [!HIGHRES_SAMPLER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_sampler)\n * [!HIGHRES_SCHEDULER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_scheduler)\n * [!HIGHRES_STEPS](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_steps)\n * [!HIGHRES_PROMPT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_prompt)\n * [!HIGHRES_NEG_PROMPT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_neg_prompt)\n * [!REFINER_CKPT_FILE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#refiner_ckpt_file)\n * [!REFINER_SWITCH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#refiner_switch)\n * [!ADETAILER_USE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_MODEL](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_PROMPT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_NEG_PROMPT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_CKPT_FILE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_VAE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_STRENGTH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_SAMPLER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_SCALE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n * [!ADETAILER_CLIP_SKIP](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#adetailer_use)\n\nThese directives are valid only in the [config] section of **standard** prompt files (!MODE = standard):\n\n * [!REPEAT](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#repeat)\n * [!NEXT_PROMPT_FILE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#next_prompt_file)\n\nThese directives are valid only in the [config] section of **random** prompt files (!MODE = random):\n\n * [!MIN_SCALE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#min_scale)\n * [!MAX_SCALE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#max_scale)\n * [!MIN_STRENGTH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#min_strength)\n * [!MAX_STRENGTH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#max_strength)\n * [!RANDOM_INPUT_IMAGE_DIR](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#random_input_image_dir)\n\nFinally, these special directives are valid only in **process** prompt files (!MODE = process):\n\n * [!OVERRIDE_CKPT_FILE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#override_ckpt_file)\n * [!OVERRIDE_VAE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#override_vae)\n * [!OVERRIDE_MAX_OUTPUT_SIZE](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#override_max_output_size)\n * [!OVERRIDE_SAMPLER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#override_sampler)\n * [!OVERRIDE_STEPS](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#override_steps)\n * [!UPSCALE_SD_STRENGTH](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_sd_strength)\n * [!UPSCALE_ULT_MODEL](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#upscale_ult_model)\n\nCommand Help and Usage Examples:\n\n#### !MODE\nSets the prompt file mode to either **standard** (default) or **random**. Standard prompt files work by iterating through all possible [prompts] sections combinations, and random prompt files simply pick prompts at random from [prompts] sections. See [prompts/example-standard.prompts](https://github.com/rbbrdckybk/dream-factory/blob/main/prompts/example-standard.prompts) and [prompts/example-random.prompts](https://github.com/rbbrdckybk/dream-factory/blob/main/prompts/example-random.prompts) for a detailed walkthrough of how each mode works.\n```\n!MODE = standard\n```\nNote that a third option for !MODE exists (**!MODE = process**) that enables advanced users to set up batch processing tasks on existing images (e.g.: batch upscaling, metadata tagging, renaming, etc) using Dream Factory. You can see an [example process .prompts file here](https://github.com/rbbrdckybk/dream-factory/blob/main/prompts/example-process.prompts).\n#### !DELIM\nSets the delimiter that will be used when joining [prompts] sections (default is a space). For example, if you have two [prompts] sections, and the top entry in the first is \"a portrait of\" and the top entry in the second is \"a cat\", then when the two sections are combined, you'd end up with \"a portrait of a cat\" if !DELIM = \" \". \n```\n!DELIM = \" \"\n```\n#### !WIDTH\nSets the output image width, in pixels (default is 512). Note that this must be a multiple of 64!\n```\n!WIDTH = 512\n```\n#### !HEIGHT\nSets the output image height, in pixels (default is 512). Note that this must be a multiple of 64!\n```\n!HEIGHT = 512\n```\n#### !HIGHRES_FIX\nEnables or disables the Auto1111 [highres fix](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#highres-fix). Valid options are **yes** or **no** (default). This should be enabled when generating images at resolutions signficantly higher than 512x512.\n```\n!HIGHRES_FIX = no\n```\nAs of 2023-09-22, there is a **HIRES_FIX_MODE** option in your Dream Factory config.txt file that allows you to specify **simple** (default) or **advanced**. If you set ```HIRES_FIX_MODE = advanced```, you'll enable the ability to specify your initial image generation size, as well as a scaling factor that determines final size (see [**!HIGHRES_SCALE_FACTOR**](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#highres_scale_factor) below).\n\nIn the default **simple** mode, you simply set !WIDTH and !HEIGHT in .prompts files to your desired final output image size and intermediate steps are handled for you automatically.\n#### !STEPS\nThe number of denoising steps (default = 20). More steps will generally improve image quality to a point, at the cost of processing time.\n```\n!STEPS = 20\n```\nYou may also specify a range (e.g. !STEPS = 30-55) and a random value within your range will be chosen when the prompt is executed.\n#### !SAMPLER\nThe sampler to use (default is DPM++ 2M). This must match an available option in your Auto1111 SD webui exactly. You can press ctrl+h or click the help icon at the top right corner of the editor to see a reference list of available samplers (click on a sampler to copy it to the clipboard so that you can easily paste it into the editor).\n```\n!SAMPLER = DPM++ 2M\n```\n#### !SCHEDULER\nThe scheduler to use (default is Automatic). This must match a value from the Auto1111 webui (Uniform, Karras, Exponential, Polyexponential, SGM Uniform).\n```\n!SCHEDULER = Karras\n```\nSet to nothing or Automatic to return to the default.\n#### !SCALE\nThe guidance scale, or how closely you want Stable Diffusion to follow your text prompt. The default is 7.5, and generally speaking useful values are between 5 - 30.\n```\n!SCALE = 7.5\n```\nYou may also specify a range (e.g. !SCALE = 5.5 - 9) and a random value within your range will be chosen when the prompt is executed.\n#### !SAMPLES\nHow many images to produce of each prompt before moving on to the next one (default = 1). Unlike the below BATCH_SIZE option, there is no additional cost in terms of GPU memory when increasing this. There will be a liner increase in processing time when increasing this (e.g.: !SAMPLES = 10 will take ten times as long as !SAMPLES = 1).\n```\n!SAMPLES = 1\n```\n#### !BATCH_SIZE\nHow many images you want each GPU to produce in parallel (default = 1). Each increase of BATCH_SIZE will require more GPU VRAM, and setting this value too high will cause GPUs to run out of memory and crash. However, as long as you know you have enough VRAM, you can achieve moderate speed gains by increasing this beyond 1. This is an advanced setting and isn't included in new prompt file templates, however you may manually add it to your prompt files.\n```\n!BATCH_SIZE = 1\n```\n#### !INPUT_IMAGE\nSets an image to use as a starting point for the denoising process, rather than the default random noise. This can be a relative (to the Dream Factory base directory) or absolute path, and setting this to nothing will clear any previously-set input image.\n```\n!INPUT_IMAGE = C:\\images\\dog.png                         # specifies the full path to an input image\n!INPUT_IMAGE = cat.jpg                                   # specifies an input image 'cat.jpg' in the DF home directory\n!INPUT_IMAGE =                                           # specifies no input image should be used\n```\nNote that you may also pass a directory of images to this directive:\n```\n!INPUT_IMAGE = C:\\images\n```\nIf a directory is passed, every image in the folder will be applied to the prompt(s) that follow.\n#### !STRENGTH\nSets the strength of the input image influence. Valid values are 0-1 (default = 0.75). Values close to 0 will result in an output image very similar to the input image, and values close to 1 will result in images with less resemblence. Generally, values between 0.2 - 0.8 are most useful. Note that this is also used when !HIGHRES_FIX = yes to indicate how closely the final image should mirror the low-res initialization image.\n```\n!STRENGTH = 0.75\n```\nYou may also specify a range (e.g. !STRENGTH = 0.55 - 0.75) and a random value within your range will be chosen when the prompt is executed.\n#### !CKPT_FILE\nSets the model to use. Any custom models should be installed to the appropriate models directory of your auto1111 installation. You can press ctrl+h or click the help icon at the top right corner of the editor to see a reference list of available models (click on a model to copy it to the clipboard so that you can easily paste it into the editor). Setting this to nothing will default back to whatever model you have set in your config.txt file (if you haven't set a default, setting this to nothing won't do anything!).\n\nYou many also set a list of comma-separated models here. In standard mode, Dream Factory will render all prompts with the first model, then the second, and so on. In random mode, Dream Factory will switch models every 50 prompts (this interval can be changed in your config.txt file).\n\nYou may also use the reserved word \"all\" here, and Dream Factory will rotate through all of your available models automatically.\n\n**Note that you may only specify more than one model in the [config] section; model rotation is not supported anywhere else!**\n```\n!CKPT_FILE = analog-style.ckpt                           # sets a new model to use\n!CKPT_FILE = sd-v1-5-vae.ckpt, analog-style.ckpt         # sets 2 models to rotate between\n!CKPT_FILE = all                                         # will rotate between all of your models\n!CKPT_FILE =                                             # sets the default model specified in your config.txt\n```\nNote: this uses a substring match on the valid server values available via the integrated reference, so for example if 'SD_1.5\\dreamshaper_4BakedVae.safetensors [7f16bbcd80]' is what the reference reports, then setting **!CKPT_FILE = dreamshaper_4BakedVae.safetensors** will find it.\n#### !VAE\nSets the VAE to use. Set this to nothing to revert to automatic VAE usage (or whatever your Auto1111 config setting specifies).\n```\n!VAE = vae-ft-mse-840000-ema-pruned.ckpt\n!VAE = \n```\nNote: substring matches are valid here. Setting **!VAE = vae-ft-mse-840000** will find vae-ft-mse-840000-ema-pruned.ckpt, for example.\n#### !NEG_PROMPT\nSpecifies a negative prompt to be used for all of the prompts that follow it (remember you can place most directives directly into [prompts] sections of standard prompt files!). If you have a 'catch-all' negative prompt that you tend to use, you can specify it in your config.txt file and it'll be populated as the default on new prompt files you create. Setting this to nothing will clear the negative prompt.\n```\n!NEG_PROMPT = watermark, blurry, out of focus\n```\n#### !AUTO_INSERT_MODEL_TRIGGER\nFor use with custom models that require a 'trigger word' that has been set up in your model-triggers.txt file (see [Custom Models](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#custom-models) below). This allows you to control the placement of the automatically-inserted trigger word. Valid options are **start** (default), **end**, **first_comma**, **keyword:[keyword to replace]** and **off**: 'start' will put the trigger word at the front of the prompt, 'end' will place it at the end, 'first_comma' will place it after the first comma (or at the end if there is no comma in the prompt), 'keyword:' will replace the specified keyword/phrase in the prompt with the model trigger word, and 'off' will disable auto-insertion entirely.\n```\n!AUTO_INSERT_MODEL_TRIGGER = start\n```\nNote that this will also control the behavior of automatic trigger insertion into your HIGHRES_PROMPT (if present), assuming that a valid HIGHRES_CKPT_FILE has been set with associated trigger words.\n#### !SEED\nSpecifies the seed value to be used in image creation. This value is normally chosen at random - using the same settings with the same seed value should produce exactly the same output image. Setting this to nothing will indicate that random seed values should be used (the default). This is an advanced setting and isn't included in new prompt file templates, however you may manually add it to your prompt files.\n```\n!SEED = 42\n```\n#### !USE_UPSCALE\nWhether or not every output image should automatically be upscaled. Upscaling can take a significant amount of time, so generally you'd only want to do this on a subset of selected images. Valid options are **yes** or **no** (default).\n```\n!USE_UPSCALE = no\n```\n#### !UPSCALE_MODEL\nSets the upscaling model to use.\n```\n!UPSCALE_MODEL = esrgan\n```\nNote that this will perform a substring match on any upscalers you have installed with Auto1111. In this case, **ESRGAN_4x*** should be selected (and is also the default).\n\nIn **!MODE = PROCESS** .prompts files, you may additionally specify **!UPSCALE_MODEL = SD** or **!UPSCALE_MODEL = ULTIMATE**. \n\n**SD** is a special option that uses Stable Diffusion's img2img engine to upscale your images. This will take much longer than other methods and requires a lot of GPU VRAM to reach large image sizes (~12GB of VRAM is required to output 2048x2048 images), but will potentially produce higher quality results with the ability to add detail. Use !UPSCALE_SD_STRENGTH = xxx (default is 0.3) to control denoising strength with !UPSCALE_MODEL = SD.\n\nThis option works very similarly to how the highres fix in Auto1111 does. It allows you to take an image and use Stable Diffusion to create a larger version, changing the image slightly depending on the denoising strength used (the 0.3 default value should stay very close to the original in most cases).\n```\n!UPSCALE_MODEL = sd\n!UPSCALE_SD_STRENGTH = 0.3\n```\n*To use !UPSCALE_MODEL = sd, you must first add MAX_OUTPUT_SIZE to your Dream Factory config.txt file (see config-default.txt for explanation).*\n\n**ULTIMATE** is a special option that requires the [Ultimate SD Upscale extension](https://github.com/Coyote-A/ultimate-upscale-for-automatic1111) to be added in your AUTOMATIC1111 installation.\n\nOnce installed, you can control the settings of the extension with the following directives (in the below example, we set denoising strength to 0.28, use ESRGAN_4x as our upscaler, and upscale the original image by a factor of 2.5x).\n```\n!UPSCALE_MODEL = ultimate\n!UPSCALE_SD_STRENGTH = 0.28\n!UPSCALE_ULT_MODEL = esrgan\n!UPSCALE_AMOUNT = 2.5\n```\nSee the bottom of the example-process.prompts file in your Dream Factory /prompts directory for more information.\n\n*To use !UPSCALE_MODEL = ultimate, you must first install the [Ultimate SD Upscale extension](https://github.com/Coyote-A/ultimate-upscale-for-automatic1111) to Auto1111.*\n#### !UPSCALE_AMOUNT\nThe factor to upscale by. Setting !UPSCALE_AMOUNT = 2 will double the width and height of an image (resulting in quadruple the resolution). Has no effect unless !USE_UPSCALE = yes.\n```\n!UPSCALE_AMOUNT = 2\n```\n#### !UPSCALE_CODEFORMER_AMOUNT\nThe visibility of [Codeformer face enhancement](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#face-restoration) on the output image. Valid values are between 0-1. Setting this to 0 disables Codeformer enhancement entirely. Has no effect unless !USE_UPSCALE = yes.\n```\n!UPSCALE_CODEFORMER_AMOUNT = 0.50\n```\n#### !UPSCALE_GFPGAN_AMOUNT\nThe visibility of [GFPGAN face enhancement](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#face-restoration) on the output image. Valid values are between 0-1. Setting this to 0 disables GFPGAN enhancement entirely. Has no effect unless !USE_UPSCALE = yes.\n```\n!UPSCALE_GFPGAN_AMOUNT = 0.50\n```\n#### !UPSCALE_KEEP_ORG\nWhen upscaling, keep the original (non-upscaled) image as well? Valid options are **yes** or **no** (default). If set to yes, originals will be stored in an /originals sub-directory off the main output folder. Has no effect unless !USE_UPSCALE = yes.\n```\n!UPSCALE_KEEP_ORG = no\n```\n#### !FILENAME\nAllows you to specify a custom output filename. You may use the following variables; they will be filled in when the image is created:\n* ```\u003cad-model\u003e```\n* ```\u003cad-strength\u003e```\n* ```\u003ccn-img\u003e```\n* ```\u003ccn-model\u003e```\n* ```\u003cdate\u003e```\n* ```\u003cdate-year\u003e```\n* ```\u003cdate-month\u003e```\n* ```\u003cdate-day\u003e```\n* ```\u003cheight\u003e```\n* ```\u003chr-model\u003e```\n* ```\u003cinput-img\u003e```\n* ```\u003clora\u003e```\n* ```\u003cmodel\u003e```\n* ```\u003cneg-prompt\u003e```\n* ```\u003cprompt\u003e```\n* ```\u003csampler\u003e```\n* ```\u003cscheduler\u003e```\n* ```\u003cscale\u003e```\n* ```\u003cseed\u003e```\n* ```\u003csteps\u003e```\n* ```\u003cstrength\u003e```\n* ```\u003cstyles\u003e```\n* ```\u003ctime\u003e```\n* ```\u003cwidth\u003e```\n\nIn **process** mode files, the following are available:\n* ```\u003cupscale-model\u003e```\n* ```\u003cupscale-sd-strength\u003e```\n\nThe file extension (.jpg) will be added automatically.\n```\n!FILENAME = \u003cdate-year\u003e\u003cdate-month\u003e\u003cdate-day\u003e-\u003cmodel\u003e-\u003cwidth\u003ex\u003cheight\u003e-\u003cprompt\u003e\n```\nThe above example might produce an output filename of **20230209-deliberate_v11-768x1280-a-photo-of-a-cute-cat.jpg**, for example.\n\nNote that ```\u003cinput-img\u003e``` and ```\u003ccn-img\u003e``` (ControlNet input image) will be the base filename only (no subdirectories or file extension).\n\nCustom filenames will be truncated at 200 characters (not including file extension and any necessary numeric padding to make the file unique).\n#### !CLIP_SKIP\nSets the [CLIP skip](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#clip-skip) value. The default is 1, and most models work best with it set there. However some models may give optimal results with other values.\n```\n!CLIP_SKIP = 2\n```\nYou may set this to nothing (!CLIP_SKIP = ) to clear it.\n#### !SEAMLESS_TILING\nEnables or disables seamless tiling mode. When enabled, output images will be suitable for tiling without visible seams/edges.\n```\n!SEAMLESS_TILING = on\n```\nSet to **off** to disable (the default).\n#### !CONTROLNET_INPUT_IMAGE\nSets an input image for use with ControlNet.\n```\n!CONTROLNET_INPUT_IMAGE = poses\\examples\\openpose-standing_arms_in_front.png\n```\nThe above example will use **openpose-standing_arms_in_front.png** as the ControlNet input image. Note that this will have no effect if you do not have the ControlNet extension installed, and/or you do not also specify a ControlNet model via the [!CONTROLNET_MODEL](https://github.com/rbbrdckybk/dream-factory/tree/main/README.md#controlnet_model) directive.\n\nYou may clear previously-set input images by issuing another directive to set it to nothing (!CONTROLNET_INPUT_IMAGE = ).\n\nNote that you may also pass a directory of images to this directive:\n```\n!CONTROLNET_INPUT_IMAGE = poses\\examples\n```\nIf a directory is passed, every image in the folder will be applied to the prompt(s) that follow.\n#### !CONTROLNET_MODEL\nSets the ControlNet model to use.\n```\n!CONTROLNET_MODEL = openpose\n```\nYou may press control-H (or press the appropriate button) within the integrated editor to open a reference that displays your available ControlNet models. Note that setting a ControlNet model will have no effect if you do not have the ControlNet extension installed, and/or you do not also specify a ControlNet input image via the [!CONTROLNET_INPUT_IMAGE](https://github.com/rbbrdckybk/dream-factory/tree/main/README.md#controlnet_input_image) directive.\n\nNote that you may optionally specify **auto** for !CONTROLNET_MODEL (or **auto, [default]**) if you want Dream Factory to extract the model from your [!CONTROLNET_INPUT_IMAGE](https://github.com/rbbrdckybk/dream-factory/tree/main/README.md#controlnet_input_image) filename(s). You must name your image in the following format for this to work: ```[ControlNet model to use]-[rest of filename].ext```. For example, an image named **openpose-standing_arms_in_front.png** would indicate that the openpose model should be used when !CONTROLNET_MODEL = auto.\n```\n!CONTROLNET_MODEL = auto, depth\n```\nIn this example directive, Dream Factory will attempt to extract the model to use from your filenames, and fallback to 'depth' as a default model if your filename didn't contain a valid model. Specifying a default is optional, but if a model cannot be discerned from your filename(s) and no default is present, ControlNet will be disabled.\n\nNote: this uses a substring match on the valid server values available via the integrated reference, so for example if 'control_canny-fp16' is what the reference reports, then setting **!CONTROLNET_MODEL = canny** will find it.\n#### !CONTROLNET_PRE\nSets the ControlNet preprocessor to use. This is used to \"extract\" pose information from a normal image, so that it can then be used with the corresponding ControlNet model. If you're using pre-generated poses (such as the example ones contained in the Dream Factory **poses** folder) you do not need to set this (or you can set it to the default of 'none').\n```\n!CONTROLNET_PRE = openpose\n```\nYou may press control-H (or press the appropriate button) within the integrated editor to open a reference that displays your available ControlNet preprocessors. Note that setting a ControlNet preprocessor will have no effect if you do not have the ControlNet extension installed, and/or you do not also specify a ControlNet input image via the [!CONTROLNET_INPUT_IMAGE](https://github.com/rbbrdckybk/dream-factory/tree/main/README.md#controlnet_input_image) directive.\n#### !CONTROLNET_GUESSMODE\n*GUESSMODE is no longer supported as of CN extension v1.1.09 - see below for the replacement!*\n\nUse this to enable (yes) or disable (no, the default) guess mode (or \"non-prompt mode\") when using ControlNet. \n```\n!CONTROLNET_GUESSMODE = yes\n```\nYou can [read about guess mode here](https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode).\n#### !CONTROLNET_CONTROLMODE\nUse this to tell ControlNet to favor your prompt more than ControlNet, or vice-versa, or take a balanced approach. Options are '**balanced**' (default), '**prompt**' (to favor your prompt more), or '**controlnet**' (to favor ControlNet more). \n```\n!CONTROLNET_CONTROLMODE = balanced\n```\nYou can [read about control mode here](https://github.com/Mikubill/sd-webui-controlnet/issues/1011).\n#### !CONTROLNET_PIXELPERFECT\nUse this to enable (yes) or disable (no, the default) pixel perfect mode when using ControlNet. When enabling this, the image height and width you specified (with !WIDTH and !HEIGHT) will be used to generate ControlNet's preprocessed image.\n```\n!CONTROLNET_PIXELPERFECT = yes\n```\n#### !CONTROLNET_LOWVRAM\nUse this to enable (yes) or disable (no, the default) low VRAM mode when using ControlNet. \n```\n!CONTROLNET_LOWVRAM = yes\n```\nThis may be helpful if you have a GPU with less VRAM.\n#### !CONTROLNET_WEIGHT\nUse this to set the weight of the ControlNet (default = 1.0; set between 0-2). \n```\n!CONTROLNET_WEIGHT = 1.0\n```\n#### !AUTO_SIZE\nAllows you to have Dream Factory automatically size your output images based in the size of input images or ControlNet input images. Valid options are **match_input_image_size**, **match_controlnet_image_size**, **match_input_image_aspect_ratio**, **match_controlnet_image_aspect_ratio**, **resize_longest_dimension:[size]**, or **off** (default).\n```\n# output image will be set to the same size as your input image, regardless of any !WIDTH \u0026 !HEIGHT directives\n!AUTO_SIZE = match_input_image_size\n\n# output image will use the larger of your !WIDTH \u0026 !HEIGHT directives as the longer output dimension\n# the shorter output dimension will be calculated so that the output image has the same aspect ratio as the ControlNet input image\n!AUTO_SIZE = match_controlnet_image_aspect_ratio\n\n# the output image will be re-sized so that the longer of your !WIDTH/!HEIGHT settings becomes the size specified here\n# the shorter dimension will be calculated to maintain the same aspect ratio as the original !WIDTH/!HEIGHT settings\n# useful if you have an existing prompt file full of size directives and want to quickly change the size on all of them\n!AUTO_SIZE = resize_longest_dimension: 1280\n```\nNote that all resizings will result in image dimensions that are divisible by 64 (both dimensions will be rounded down to the nearest divisible-by-64 number).\n\nFor example, with **!AUTO_SIZE = match_controlnet_image_aspect_ratio**, if you set both your !WIDTH and !HEIGHT to 1408, and pass a 1920x1080 ControlNet input image (16:9 aspect ratio), the resulting output image will be 1408x768. The larger dimension has been set to the larger of your !WIDTH \u0026 !HEIGHT setting, and the smaller dimension has been calculated to be as close as possible to a 16:9 aspect ratio with a smaller dimension that is evenly divisble by 64.\n#### IPTC_TITLE\nSets the image's title in embedded [IPTC metadata](https://www.iptc.org/standards/photo-metadata/). Generally only useful if you plan to export your images into some other application that uses IPTC standards for cataloging, etc.\n```\nIPTC_TITLE = Super awesome AI kitten image!\n```\nSet this to nothing to clear it, as usual.\n#### IPTC_DESCRIPTION\nSets the image's description in embedded [IPTC metadata](https://www.iptc.org/standards/photo-metadata/). Generally only useful if you plan to export your images into some other application that uses IPTC standards for cataloging, etc.\n```\nIPTC_DESCRIPTION = This is an excellent AI image of a cute kitten.\n```\nSet this to nothing to clear it, as usual.\n#### IPTC_KEYWORDS\nSets the image's keywords in embedded [IPTC metadata](https://www.iptc.org/standards/photo-metadata/). Generally only useful if you plan to export your images into some other application that uses IPTC standards for cataloging, etc. Keywords should be a comma-separated list.\n```\nIPTC_KEYWORDS = ai, kitten, cute\n```\nSet this to nothing to clear it, as usual.\n#### IPTC_COPYRIGHT\nSets the image's copyright statement in embedded [IPTC metadata](https://www.iptc.org/standards/photo-metadata/). Generally only useful if you plan to export your images into some other application that uses IPTC standards for cataloging, etc.\n```\nIPTC_COPYRIGHT = Copyright © 2023 Super Awesome Image Studio\n```\nSet this to nothing to clear it, as usual.\n#### !REPEAT\nTells Dream Factory whether or not to continuing producing images after it has finished all possible combinations in the prompt file. Options are **yes** (default) or **no**. If set to no, Dream Factory will idle after it has completed all prompts.\n```\n!REPEAT = yes\n```\n#### !NEXT_PROMPT_FILE\nAllows you to specify another prompt file to load when the current file finishes processing. Do not include a path; Dream Factory will automatically look for prompt files in the prompt location specified in your config.txt file. Note that this will have no effect in random prompt files or standard prompt files with *!REPEAT = yes*, since those files will run forever.\n```\n!NEXT_PROMPT_FILE = example-random\n```\nA .prompts file extension will be appended automatically if you omit it.\n#### !MIN_SCALE\nWhen using random mode prompt files, sets the minimum !SCALE value to use. If !MIN_SCALE and !MAX_SCALE are set to different values, Dream Factory will choose a random value between them for each prompt.\n```\n!MIN_SCALE = 6.0\n```\n*Deprecated - consider using !SCALE = x.x - xx.x format instead.*\n#### !MAX_SCALE\nWhen using random mode prompt files, sets the maximum !SCALE value to use. If !MIN_SCALE and !MAX_SCALE are set to different values, Dream Factory will choose a random value between them for each prompt.\n```\n!MIN_SCALE = 18.5\n```\n*Deprecated - consider using !SCALE = x.x - xx.x format instead.*\n#### !MIN_STRENGTH\nWhen using random mode prompt files, sets the minimum !STRENGTH value to use. If !MIN_STRENGTH and !MAX_STRENGTH are set to different values, Dream Factory will choose a random value between them for each prompt.\n```\n!MIN_STRENGTH = 0.45\n```\n*Deprecated - consider using !STRENGTH = 0.xx - 0.xx format instead.*\n#### !MAX_STRENGTH\nWhen using random mode prompt files, sets the maximum !STRENGTH value to use. If !MIN_STRENGTH and !MAX_STRENGTH are set to different values, Dream Factory will choose a random value between them for each prompt.\n```\n!MAX_STRENGTH = 0.80\n```\n*Deprecated - consider using !STRENGTH = 0.xx - 0.xx format instead.*\n#### !RANDOM_INPUT_IMAGE_DIR\nWhen using random mode prompt files, sets a directory that random input images should be pulled from. If this is set, Dream Factory will choose a random input image to use for each prompt.\n```\n!RANDOM_INPUT_IMAGE_DIR = C:\\images                      # specifies the full path to a directory containing input images\n!RANDOM_INPUT_IMAGE_DIR = images                         # specifies a relative path to a directory containing input images\n!RANDOM_INPUT_IMAGE_DIR =                                # specifies no input images should be used\n```\n#### !OVERRIDE_CKPT_FILE\nSpecial directive valid only in ```!MODE = process``` .prompts files, and only when used with ```!UPSCALE_MODEL = sd```.\nThis directive allows you to specify a different model to use (e.g. instead of the model used to create the original image) when performing an SD upscale.\n```\n!OVERRIDE_CKPT_FILE = juggernaut\n```\nNote: substring matches are valid here. In the example, \"juggernaut\" would match with the first valid model file that contains the string \"juggernaut\".\n#### !OVERRIDE_VAE\nSpecial directive valid only in ```!MODE = process``` .prompts files, and only when used with ```!UPSCALE_MODEL = sd```.\nThis directive allows you to specify a different VAE to use (e.g. instead of the VAE used to create the original image) when performing an SD upscale.\n```\n!OVERRIDE_VAE = vae-ft-mse-840000-ema-pruned\n```\nNote: substring matches are valid here. In the example, \"vae-ft-mse-840000-ema-pruned\" would match with the first valid VAE file that contains the string \"vae-ft-mse-840000-ema-pruned\".\n#### !OVERRIDE_MAX_OUTPUT_SIZE\nSpecial directive valid only in ```!MODE = process``` .prompts files, and only has any effect when used with ```!UPSCALE_MODEL = sd```.\nThis directive allows you to override the value set for MAX_OUTPUT_SIZE in your config.txt file (see config-default.txt for detailed explanation).\n```\n!OVERRIDE_MAX_OUTPUT_SIZE = 2,000,000\n```\n#### !OVERRIDE_SAMPLER\nSpecial directive valid only in ```!MODE = process``` .prompts files, and only has any effect when used with ```!UPSCALE_MODEL = sd```.\nThis directive allows you to specify a different sampler to use (e.g. instead of the sampler used to create the original image) when performing an SD upscale.\n```\n!OVERRIDE_SAMPLER = DPM++ 2M Karras\n```\n#### !OVERRIDE_STEPS\nSpecial directive valid only in ```!MODE = process``` .prompts files, and only has any effect when used with ```!UPSCALE_MODEL = sd```.\nThis directive allows you to specify a different number of steps (e.g. instead of the step value used to create the original image) when performing an SD upscale.\n```\n!OVERRIDE_STEPS = 40\n```\nNote that you're overriding the number of steps used to create the **original** image, not setting the number of steps to use for the actual upscaling (which is determined by a combination of the step value and the !UPSCALE_SD_STRENGTH). So for example, if the original image was created with 120 steps, and you set ```!OVERRIDE_STEPS = 40``` in a !PROCESS_MODE SD upscale job that uses ```!UPSCALE_SD_STRENGTH = 0.30```, then the final output image will have ~13 steps (40 * 0.3) instead of 40 steps (120 * 0.3).\n#### !UPSCALE_SD_STRENGTH\nAllows you to set the denoising strength when using either of the special **!MODE = process** upscaling methods (**!UPSCALE_MODEL = ultimate** or **!UPSCALE_MODEL = sd**).\n```\n!UPSCALE_SD_STRENGTH = 0.28\n```\n#### !UPSCALE_ULT_MODEL\nAllows you to set the upscale model to use when controlling the [Ultimate SD Upscale extension](https://github.com/Coyote-A/ultimate-upscale-for-automatic1111) via **!UPSCALE_MODEL = ultimate** in a **!MODE = process** .prompts file.\n```\n!UPSCALE_ULT_MODEL = remacri\n```\nNote that substring matches are allowed. In this example, the first valid Auto1111 upscaler that contains the string 'remacri' (case insensitive) will be used.\n#### !STYLES\nAllows for use of Automatic1111 styles in your Dream Factory prompts. Use a comma-separated list for multiple styles. You may also set !STYLES to **random x** to have Dream Factory choose **x** styles randomly each time a prompt is executed (```!STYLES = random``` implies a single random style).\nSet !STYLES to nothing to clear it.\n```\n!STYLES = pop art\n!STYLES = pop art, victorian, neopunk\n!STYLES = random\n!STYLES = random 4\n!STYLES =\n```\nNote: Substrings are ok (e.g.: ```!STYLES = pop``` will match with a \"pop art\" style if it exists in your Auto1111 style catalog).\n#### !HIGHRES_SCALE_FACTOR\nAllows you to specify a scaling factor to apply to your initial images in order to determine the final output size. For example, if your !WIDTH and !HEIGHT are both set to 1024, and you set **!HIGHRES_SCALE_FACTOR = 1.5**, then the final output image size will be 1536x1536.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file, **and** you've set ```HIRES_FIX_MODE = advanced``` in your Dream Factory config.txt file.\n```\n!HIGHRES_SCALE_FACTOR = 1.25\n```\nSet to nothing to clear it (the default of 2.0 will be used if you set **HIGHRES_FIX = yes** in advanced mode without specifying your own HIGHRES_SCALE_FACTOR).\n#### !HIGHRES_UPSCALER\nAllows you to specify an upscaler to use for during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_UPSCALER = ESRGAN_4x\n```\nSet to nothing to clear it (**Latent** will be used as a default if you don't set anything here and use **HIGHRES_FIX = yes**).\n#### !HIGHRES_CKPT_FILE\nAllows you to specify a different model to use during the highres fix portion of image generation. Note that you can mix and match SDXL and SD 1.5 models here (e.g. do your initial generation with SDXL and then use a SD 1.5 model for the highres fix)!\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_CKPT_FILE = epicrealism\n```\nYou may also use a comma-separated list of models. If you also use multiple models for your main model (!CKPT_FILE), then all possible combinations will be generated.\n```\n!HIGHRES_CKPT_FILE = epicrealism, deliberate, dreamshaper\n```\nSubstring matches on model filenames are ok (hashes will work, too).\nSet to nothing to clear it (**Latent** will be used as a default if you don't set anything here and use **HIGHRES_FIX = yes**).\n#### !HIGHRES_VAE\n**Not currently working; Auto1111 doesn't have an API setting for this yet!**\nAllows you to specify a different VAE to use during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_VAE = vae-ft-mse-840000-ema-pruned\n```\nSubstring matches on VAE filenames are ok.\nSet to nothing to clear it.\n#### !HIGHRES_SAMPLER\nAllows you to specify a different sampler to use during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_SAMPLER = Euler a\n```\nSet to nothing to clear it (if you don't set anything here and use **HIGHRES_FIX = yes**, then the sampler that was used during the initial generation will be used).\n#### !HIGHRES_SCHEDULER\nAllows you to specify a different scheduler to use during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_SCHEDULER = Karras\n```\nSet to nothing or Automatic to clear it (if you don't set anything here and use **HIGHRES_FIX = yes**, then the sampler that was used during the initial generation will be used).\n#### !HIGHRES_STEPS\nAllows you to specify a different number of steps during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_STEPS = 20\n```\nSet to nothing to clear it (if you don't set anything here and use **HIGHRES_FIX = yes**, then the step count that was used during the initial generation will be used).\n#### !HIGHRES_PROMPT\nAllows you to specify a different prompt during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_PROMPT = highly detailed\n```\nYou may also set this to ```\u003cremove loras\u003e```, which will use the main prompt with all LoRA/hypernet references removed. This is useful if you're using a SDXL main model \u0026 LoRA(s) and want to use a SD 1.5 model for your high-res fix (in which case the SDXL LoRAs wouldn't be compatible with the SD 1.5 model), for example.\n```\n!HIGHRES_PROMPT = \u003cremove loras\u003e\n```\nFinally, you can use the special token **\u003cprompt\u003e** within !HIGHRES_PROMPT to reference the original/main prompt. Useful if you want to add to the original prompt in some way.\n```\n!HIGHRES_PROMPT = \u003cprompt\u003e, highly detailed, 8k\n```\nSet to nothing to clear it (if you don't set anything here and use **HIGHRES_FIX = yes**, then the prompt that was used during the initial generation will be used).\n#### !HIGHRES_NEG_PROMPT\nAllows you to specify a different negative prompt during the highres fix portion of image generation.\nThis has no effect unless ```!HIGHRES_FIX = yes``` is also set in your .prompts file.\n```\n!HIGHRES_NEG_PROMPT = ugly\n```\nYou may also use the special token **\u003cneg_prompt\u003e** within !HIGHRES_NEG_PROMPT to reference the original/main negative prompt. Useful if you want to add to the original negative prompt in some way.\n```\n!HIGHRES_NEG_PROMPT = \u003cneg_prompt\u003e, illustration, drawing\n```\nSet to nothing to clear it (if you don't set anything here and use **HIGHRES_FIX = yes**, then the negative prompt that was used during the initial generation will be used).\n#### !REFINER_CKPT_FILE\nAllows you to specify a refiner model to use.\n```\n!REFINER_CKPT_FILE = sd_xl_base_1.0_refiner\n```\nSubstring matches on model filenames are ok (hashes will work, too).\nSet to nothing to clear it.\n#### !REFINER_SWITCH\nAllows you to specify when the refiner model should be switched to during image generation (0 - 1). For example, setting 0.50 here will perform the switch exactly halfway into generation.\n```\n!REFINER_SWITCH = 0.75\n```\nSet to nothing to clear it (if you don't set anything here but use **!REFINER_CKPT_FILE**, then 0.8 will be used as a default).\n#### !ADETAILER_USE\nAllows you to control the ADetailer extension via Dream Factory directives. Note that you must have installed the [ADetailer extension](https://github.com/Bing-su/adetailer) to use these!\n```\n!ADETAILER_USE = yes\n!ADETAILER_MODEL = face_yolov8n.pt\n```\nThe above commands are the minimum required to activate ADetailer. Note that there is currently no way to verify that the value provided to **!ADETAILER_MODEL** is valid via API calls, so if you supply an invalid model here, you'll see errors (you can see a list of your available models via your Auto1111 UI)!\n\nSet !ADETAILER_USE to **no** to deactivate ADetailer.\n\nIn addition, the following optional directives allow for additional control:\n```\n# set these to use a specific checkpoint and/or vae during the ADetailer step\n# substring matches are ok here\n!ADETAILER_CKPT_FILE = deliberate\n!ADETAILER_VAE = vae-ft-mse-840000-ema-pruned\n\n# set these to use a specific prompt/negative prompt during the ADetailer step\n# these will target only the area that ADetailer inpaints (e.g. faces, hands, etc)\n!ADETAILER_PROMPT = detailed studio portrait of a middle-aged man\n!ADETAILER_NEG_PROMPT = hands, cartoon, cgi, render, illustration, painting, drawing\n\n# set these to override default ADetailer values\n!ADETAILER_STRENGTH = 0.75\n!ADETAILER_SCALE = 7.5\n!ADETAILER_SAMPLER = Euler\n!ADETAILER_CLIP_SKIP = 1\n```\nNote that you may use these ADetailer directives in either normal (!MODE = standard) or process (!MODE = process) .prompts files. The most efficient workflow is to probably generate initial images without ADetailer enabled, and then set up a process .prompts file to batch process a folder of selected images (e.g. to fix faces/hands/etc).\n\n## Viewing your Images\n\nYou can click 'Gallery' in the top nav from any page to see the images that Dream Factory has produced for you. By default, you'll be looking at the most recently-created 200 images (the max number of images to display can be changed in your config.txt file via the GALLERY_MAX_IMAGES setting). You can also select a specific output folder to browse via the dropdown near the top of the page.\n\nWhen selecting a specific folder to browse, a zip icon will appear next to the folder name. Clicking this will download the entire folder of images as a .zip file.\n\nClicking any image will open an expanded view of that image, and also display the selected image's associated metadata. While viewing an image, there are several additional commands available - these are represented by icons located over the image. Mousing over each icon will bring up a help bubble explaining the how each works, along with the command's associated hotkey (e.g.: left and right arrow keys to browse images, 'del' to delete an image, etc.).\n\nWhen deleting images via the hotkey (the 'del' key), note that the confirmation dialog is disabled to allow you to quickly delete large numbers of images (clicking the delete icon above the image will prompt you to confirm the deletion via an additional popup). If you accidentally delete images that you meant to keep, you can recover them in your ```[dream factory]/server/temp``` folder **before** you shut Dream Factory down (this folder is cleaned out on every shutdown!).\n\nWhile Dream Factory is not really intended to be used on mobile devices, you can swipe left and right when viewing images in the gallery to quickly browse. Swiping down while viewing an image will bring up the delete confirmation dialog. Swipe interactions have only been tested on Chrome for Android and aren't guaranteed to work properly on other mobile platforms.\n\n# Advanced Usage\n\nSome usage scenarios for more advanced users can be found here.\n\n## Wildcards\n\nWildcard files are simple text files placed into your dream-factory/prompts/wildcards directory. You can reference these wildcards by using `__[wildcard filename]__` (that's 2 underscores, followed by the wildcard filename without the .txt extension, followed by 2 more underscores) from within any of your prompt file [prompts] sections. When Dream Factory builds the final prompt, it'll replace the wildcard reference with a random line from the file.\n\nYou can press ctrl+h or click the help button when editing prompt files with the integrated editor to see a list of your available wildcards (click one to copy it to the clipboard for easy inclusion in your prompt files!).\n\nAn example colors.txt file is included. Specifying `__colors__` in any of your prompts will pull in a random color.\n\nNested wildcards (references to wildcards within a wildcard file) are permitted (as of 2023-02-16).\n\n## Custom Models\n\nAny custom models that you've placed in your Auto1111 models directory are available to use within Dream Factory via the [!CKPT_FILE directive](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#ckpt_file). For models that require a trigger word (for example, the [Mo-Di model](https://huggingface.co/nitrosocke/mo-di-diffusion) requires you to place the phrase 'modern disney style' somewhere in your prompt), you can have Dream Factory automatically insert these for you.\n\nAfter each Dream Factory startup (after the first GPU is fully initialized), a **model-triggers.txt** file will be created/updated in your Dream Factory root folder. Each of your available models should show up in this file, followed by a comma. To associate a trigger phrase/token with a model, simply place it after the comma for that model's entry. For example, the following entry would associate 'modern disney style' with the model named 'moDi-v1-pruned.ckpt':\n```\nmoDi-v1-pruned.ckpt [ccf3615f], modern disney style\n```\nYou can control the placement of the auto-inserted trigger word with [!AUTO_INSERT_MODEL_TRIGGER](https://github.com/rbbrdckybk/dream-factory/blob/main/README.md#auto_insert_model_trigger).\n\nNote that if you have Civitai integration enabled, entries in your model-triggers.txt file will take precedence over trigger words scraped from Civitai.\n\n## Embeddings\n\nIf you've installed any [textual inversion embeddings into your Auto1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion) SD webui, you can reference them via the integrated prompt editor's built-in help.\n\nJust press ctrl+h or click the help button when editing prompt files with the integrated editor to see a list of your available embeddings (click one to copy it to the clipboard for easy inclusion in your prompt files!).\n\n## ControlNet\n\n(2023-03-13 Note: this should be considered WIP - the editor reference pages are pretty rough and there may be some bugs!)\n\nIf you've installed the [Auto1111 ControlNet extension](https://github.com/Mikubill/sd-webui-controlnet) and have at least one of ControlNet [pre-trained models](https://civitai.com/models/9251/controlnet-pre-trained-models) installed, then ControlNet functionality should automatically be enabled within Dream Factory.\n\n### ControlNet Prompt File Directives\n\nYou can reference current [ControlNet prompt file directives here](https://github.com/rbbrdckybk/dream-factory#controlnet_input_image).\n\nNote that at minimum, you'll need to set both **!CONTROLNET_INPUT_IMAGE** and **!CONTROLNET_MODEL** in your prompt file to activate ControlNet.\n\n### ControlNet Poses\n\nIf you have a library of ControlNet poses, you may place them into the **poses** directory located off your main Dream Factory folder. Pose image files may be organized into their own folders (no more than one level deep).\n\nOptional: you may additionally create a **previews** sub-directory in each of these folders. Within the **previews** sub-folder, you may place a rendered image that corresponds to each pose file - these previews must be named the same as the pose file (though you may have different image formats; currently .jpg or .png will work). These previews will appear alongside the pose image files in the Dream Factory integrated prompt editor reference.\n\nCheck out the **poses\\examples** Dream Factory folder for a couple examples of pose image files, and their corresponding preview files. You should be able to view these within the Dream Factory prompt file editor reference area (press control-H while editing any prompt file to open).\n\n### ControlNet Tips\n* If you do not want the pre-processor image map as an additional output when using the **!CONTROLNET_PRE** directive, you may disable this within the Auto1111 UI. Go to Settings -\u003e ControlNet -\u003e Do not append detectmap to output.\n\n# Updating Dream Factory\n\nYou can update Dream Factory to the latest version by typing:\n```\npython setup.py --update\n```\n\n# Troubleshooting\n\nFixes for common issues may be found here.\n\n## Compatibility with Automatic1111\n\nDue to Automatic's lack of a clear license for his Automatic1111 repo, I've elected to not package Dream Factory with it's own version of the Automatic1111 SD webui. If Automatic makes significant changes to Automatic1111 in the future, it's possible that Dream Factory may stop working. I'll try to keep this updated with the hash to the latest known-working version of Automatic1111 in case issues arise.\n\nYou can grab a known-compatible version of Automatic1111's SD webui by going to your Auto1111 installation directory and typing this at the command-line:\n```\ngit checkout 82a973c04367123ae98bd9abdf80d9eda9b910e2\n```\nIf you get an error that the hash reference is not a tree, run ```git pull``` and try again.\n\nIf/when you want to go back to the latest version, you can just run ```git checkout master```.\n\n(updated 2024-07-27, previous supported hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbbrdckybk%2Fdream-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbbrdckybk%2Fdream-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbbrdckybk%2Fdream-factory/lists"}