"\u267b\ufe0f":"Reuse seed from last generation, mostly useful if it was randomed",
"\u{1f3a8}":"Add a random artist to the prompt.",
"\u2199\ufe0f":"Read generation parameters from prompt into user interface.",
"\uD83D\uDCC2":"Open images output directory",
"\u{1f4c2}":"Open images output directory",
"Inpaint a part of image":"Draw a mask over an image, and the script will regenerate the masked area with content according to prompt",
"SD upscale":"Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back",
...
...
@@ -47,6 +47,7 @@ titles = {
"Custom code":"Run Python code. Advanced user only. Must run program with --allow-code for this to work",
"Prompt S/R":"Separate a list of words with commas, and the first word will be used as a keyword: script will search for this word in the prompt, and replace it with others",
"Prompt order":"Separate a list of words with commas, and the script will make a variation of prompt with those words for their every possible order",
"Tiling":"Produce an image that can be tiled.",
"Tile overlap":"For SD upscale, how much overlap in pixels should there be between tiles. Tiles overlap so that when they are merged back into one picture, there is no clearly visible seam.",
# a prompt like this: "fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5]"
# will be represented with prompt_schedule like this (assuming steps=100):
...
...
@@ -23,71 +11,96 @@ re_prompt = re.compile(r'''
# [75, 'fantasy landscape with a lake and an oak in background masterful']
# [100, 'fantasy landscape with a lake and a christmas tree in background masterful']
@@ -46,6 +46,7 @@ parser.add_argument("--ldsr-models-path", type=str, help="Path to directory with
parser.add_argument("--opt-split-attention",action='store_true',help="force-enables cross-attention layer optimization. By default, it's on for torch.cuda and off for other torch devices.")
parser.add_argument("--opt-split-attention-v1",action='store_true',help="enable older version of split attention optimization that does not consume all the VRAM it can find")
parser.add_argument("--use-cpu",nargs='+',choices=['SD','GFPGAN','BSRGAN','ESRGAN','SCUNet','CodeFormer'],help="use CPU as torch device for specified modules",default=[])
parser.add_argument("--listen",action='store_true',help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests")
parser.add_argument("--port",type=int,help="launch gradio with given server port, you need root/admin rights for ports < 1024, defaults to 7860 if available",default=None)
parser.add_argument("--show-negative-prompt",action='store_true',help="does not do anything",default=False)
...
...
@@ -54,6 +55,7 @@ parser.add_argument("--hide-ui-dir-config", action='store_true', help="hide dire
parser.add_argument("--ui-settings-file",type=str,help="filename to use for ui settings",default=os.path.join(script_path,'config.json'))
parser.add_argument("--gradio-debug",action='store_true',help="launch gradio with --debug option")
parser.add_argument("--gradio-auth",type=str,help='set gradio authentication like "username:password"; or comma-delimit multiple like "u1:p1,u2:p2,u3:p3"',default=None)
parser.add_argument("--gradio-img2img-tool",type=str,help='gradio image uploader tool: can be either editor for ctopping, or color-sketch for drawing',choices=["color-sketch","editor"],default="color-sketch")
parser.add_argument("--opt-channelslast",action='store_true',help="change memory type for stable diffusion to channels last")
parser.add_argument("--styles-file",type=str,help="filename to use for styles",default=os.path.join(script_path,'styles.csv'))
parser.add_argument("--autolaunch",action='store_true',help="open the webui URL in the system's default browser upon launch",default=False)
"save_images_before_color_correction":OptionInfo(False,"Save a copy of image before applying color correction to img2img results"),
"img2img_fix_steps":OptionInfo(False,"With img2img, do exactly the amount of steps the slider specifies (normally you'd do less with less denoising)."),
"enable_quantization":OptionInfo(False,"Enable quantization in K samplers for sharper and cleaner results. This may change existing seeds. Requires restart to apply."),
"enable_emphasis":OptionInfo(True,"Eemphasis: use (text) to make model pay more attention to text and [text] to make it pay less attention"),
"enable_emphasis":OptionInfo(True,"Emphasis: use (text) to make model pay more attention to text and [text] to make it pay less attention"),
"use_old_emphasis_implementation":OptionInfo(False,"Use old emphasis implementation. Can be useful to reproduce old seeds."),
"enable_batch_seeds":OptionInfo(True,"Make K-diffusion samplers produce same images in a batch as when making a single image"),
"show_progress_every_n_steps":OptionInfo(0,"Show show image creation progress every N sampling steps. Set 0 to disable.",gr.Slider,{"minimum":0,"maximum":32,"step":1}),
"return_grid":OptionInfo(True,"Show grid in results for web"),
"do_not_show_images":OptionInfo(False,"Do not show any images in results for web"),
"add_model_hash_to_info":OptionInfo(True,"Add model hash to generation information"),
"font":OptionInfo("","Font for image grids that have text"),
"js_modal_lightbox":OptionInfo(True,"Enable full page image viewer"),
init_img=gr.Image(label="Image for img2img",show_label=False,source="upload",interactive=True,type="pil")
init_img=gr.Image(label="Image for img2img",elem_id="img2img_image",show_label=False,source="upload",interactive=True,type="pil",tool=cmd_opts.gradio_img2img_tool)
withgr.TabItem('Inpaint',id='inpaint'):
init_img_with_mask=gr.Image(label="Image for inpainting with mask",show_label=False,elem_id="img2maskimg",source="upload",interactive=True,type="pil",tool="sketch",image_mode="RGBA")
hidden='<br>Disabled when launched with --hide-ui-dir-config.'ifshared.cmd_opts.hide_ui_dir_configelse''
gr.HTML(f"<p class=\"text-gray-500\">Process images in a directory on the same machine where the server is running.{hidden}</p>")
gr.HTML(f"<p class=\"text-gray-500\">Process images in a directory on the same machine where the server is running.<br>Use an empty output directory to save pictures normally instead of writing to the output directory.{hidden}</p>")