###############################################################################
### Dream Factory default configuration file
###############################################################################

# Path to installed Automatic1111 stable diffusion repo (e.g.: C:\Applications\stable-diffusion-webui).
# You must populate this with a working SD installation for Dream Factory to operate!
SD_LOCATION = 

# Specify which GPU(s) to use here; auto will attempt to use all detected devices
# to specify individual GPUs, use a comma-separated list of device IDs.
# e.g. USE_GPU_DEVICES = 0, 1, 2
USE_GPU_DEVICES = auto

# Starting port that SD instances will use; additional GPUs will each increment this 
# by one when deciding which port to operate on - e.g. if you leave this at 7861 and 
# have 3 GPUs, then ports 7861, 7862, and 7863 will be used by SD instances.
# These are not accessible outside of the local machine Dream Factory operates on and 
# there is generally no reason to change this.
SD_PORT = 7861

# If you have multiple GPUs, this is how many are allowed to initialize at once. 
# Initialization only happens once at startup, but it very memory-intensive (system RAM, 
# not VRAM). Each GPU will use nearly 10GB of system RAM during initialization, so 
# allowing them all to init simultaneously may cause issues depending on system resources.
GPU_INIT_STAGGER = 1

# Directory containing your prompt files.
# Locations are relative to Dream Factory's installation directory unless specified.
PROMPTS_LOCATION = prompts

# Directory containing your wildcard files.
WILDCARD_LOCATION = prompts\wildcards

# Directory where output images will be created.
OUTPUT_LOCATION = output

# Use civitai.com integration in the editor (yes/no)?
# If yes, will attempt to grab some basic info about your models, loras, embeddings, etc from civitai.com 
# and display it in the integrated editor reference. 
CIVITAI_INTEGRATION = yes

# Use the webserver (yes/no)? This is required to use the browser interface.
WEBSERVER_USE = yes

# Port the webserver listens on.
# Note that ports under 1024 require root permission on Linux.
WEBSERVER_PORT = 8080

# Set this to yes if you want to be able to access the webserver UI from other computers.
# At the default "no" setting the web UI is inaccessible anywhere except at the local computer running the server!
WEBSERVER_NETWORK_ACCESSIBLE = no

# Enable webserver authentication?
# This is the most basic form of HTTP authentication and should not be considered secure!
# However if you're going to make this accessible via WAN/internet it's better than nothing.
WEBSERVER_USE_AUTHENTICATION = no

# Webserver login credentials; make sure to change these if you're using authentication!
WEBSERVER_AUTH_USERNAME = admin
WEBSERVER_AUTH_PASSWORD = password

# Automatically attempt to open the server interface in your browser (yes/no)?
# This has caused some confusion, but it literally does just that - it'll pop open Chrome 
# or whatever your default browser is, with Dream Factory loaded. Doesn't work all on OSes.
WEBSERVER_OPEN_BROWSER = yes

# Log webserver messages to the console (yes/no)? For debugging, leave it disabled unless you like spam.
WEBSERVER_CONSOLE_LOG = no

# Gallery maximum images to display.
GALLERY_MAX_IMAGES = 200

# Gallery refresh interval in seconds; set to zero to disable auto-refresh of gallery.
GALLERY_REFRESH = 30

# Optional folder to display in the gallery (and alias to refer to it)
GALLERY_USER_FOLDER = 
GALLERY_USER_FOLDER_ALIAS = favorites

# The editor won't attempt to apply context-sensitive color styling to prompt files over this character limit.
# Values above 200000 will significantly increase loading time for prompt files that exceed that character threshold. 
# If you're working with massive .prompt files, it's best to edit them using an external editor.
EDITOR_MAX_STYLING_CHARS = 80000

# Set the jpg quality of output image files here (1-100).
# Higher values result in overall better image quality at the cost of larger file sizes.
JPG_QUALITY = 88

# Set the maximum output image size that your GPU is capable of producing, in total pixels
# It's best to input a value about 10% less than your max txt2img images
# for example, if you can generate a 1280x1280 image, then input 1470000 
# (1280 x 1280 = 1,638,400 pixels, minus 10% is roughly 1,470,000)
# You may need some trial and error here, keep lowering until you don't get errors
# This is used when calculating the final size for automatic SD upscales
# If you set this to a number that's too high, you'll get errors!
# Suggested values to try: 12GB VRAM: 4200000   8GB VRAM: 2600000
# May need to be lower depending on your Auto1111 launch options (--xformers, --medvram etc)
# Once set, may be overridden in PROCESS mode files with !OVERRIDE_MAX_OUTPUT_SIZE
MAX_OUTPUT_SIZE = 

# Automatically use refiner models if found during !PROCESS_MODEL upscaling jobs?
# Refiner models should be named with a "_refiner" suffix to be automatically found.
# (e.g. "sd_xl_base_1.0.safetensors" and "sd_xl_base_1.0_refiner.safetensors")
AUTO_USE_REFINER = yes


# Auto1111 Hires Fix mode to use: simple (default) or advanced
# simple = equivalent to enabling Auto1111 Settings -> Compatibility -> "For hires fix, use width/height sliders to set final resolution..."
# when using simple, your !WIDTH and !HEIGHT are the final output image size, the intermediate image size will be auto-calculated
# advanced = current Auto1111 method; requires setting both initial resolution and a scaling factor that each dimension will be multiplied by
# when using advanced, your !WIDTH and !HEIGHT are the initial generation size; you must also set !HIGHRES_SCALE_FACTOR (default = 2) to determine final size!
HIRES_FIX_MODE = simple


# You can set your own defaults for prompt file settings below.
# Settings specified in individual prompt files will always override these.

PF_WIDTH = 512             			# output image final width, default is 512
PF_HEIGHT = 512            			# output image final height, default is 512
PF_HIGHRES_FIX = no					# helps a lot when generating images significantly larger than 512x512 at the cost of speed
PF_SAMPLER = DPM++ 2M			# sampler to use (create a new prompt file using the web UI to see a full list of options)
PF_STEPS = 20              			# number of steps, default = 50
PF_SCALE = 7.5              		# guidance scale, default = 7.5
PF_SAMPLES = 1						# number of images to generate per prompt
PF_USE_UPSCALE = no					# upscale output images?
PF_UPSCALE_MODEL = ESRGAN_4x		# default upscaler to use
PF_UPSCALE_AMOUNT = 2.0				# upscaling factor (2 means you'll get an image with double the width and height of the original)
PF_UPSCALE_CODEFORMER_AMOUNT = 0.0	# visibility of codeformer face enhancement (0 = off, 1 = full effect)
PF_UPSCALE_GFPGAN_AMOUNT = 0.0		# visibility of gfpgan face enhancement (0 = off, 1 = full effect)
PF_UPSCALE_SD_STRENGTH = 0.3		# denoising strength when using SD upscale
PF_UPSCALE_OVERRIDE_CKPT_FILE =		# set a default model to use when upscaling via gallery; otherwise original model will be used
PF_UPSCALE_OVERRIDE_STEPS =			# set a step count when upscaling via gallery; otherwise original steps will be used
PF_UPSCALE_KEEP_ORG = no			# keep the original non-upscaled image (yes/no)?
PF_NEG_PROMPT = 					# if you have a 'catch all' negative prompt you typically use, enter it here
PF_FILENAME =						# set a default custom filename: see https://github.com/rbbrdckybk/dream-factory#filename

# Set a default .ckpt file here so that whenever you set !CKPT_FILE to nothing (e.g. '!CKPT_FILE = '), this default 
# will be loaded. If you don't set anything here, !CKPT_FILE= will just use whatever happens to be loaded in Auto1111.
PF_CKPT_FILE =

# automatically insert the trigger word when using custom models?
# off = disable this
# start = at the start of the prompt (the default)
# end = at the end of the prompt
# first_comma = after the first comma (or end if prompt contains no commas)
# you must edit the model-triggers.txt file (auto-generated after first run) for these to work
PF_AUTO_INSERT_MODEL_TRIGGER = start

# Set the number of prompts to queue at once when using prompt files set to random mode.
# The only real reason you'd want to change this is if you're specifying multiple models (with !CKPT_FILE = model1, model2, etc).
# In random mode the models will rotate every time a batch of prompts is queued, so you can effectively control how often 
# your models will switch by setting this.
RANDOM_QUEUE_SIZE = 50