@@ -91,6 +91,7 @@ A browser interface based on Gradio library for Stable Diffusion.
...
@@ -91,6 +91,7 @@ A browser interface based on Gradio library for Stable Diffusion.
- Eased resolution restriction: generated image's dimensions must be a multiple of 8 rather than 64
- Eased resolution restriction: generated image's dimensions must be a multiple of 8 rather than 64
- Now with a license!
- Now with a license!
- Reorder elements in the UI from settings screen
- Reorder elements in the UI from settings screen
-[Segmind Stable Diffusion](https://huggingface.co/segmind/SSD-1B) support
## Installation and Running
## Installation and Running
Make sure the required [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) are met and follow the instructions available for:
Make sure the required [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) are met and follow the instructions available for:
parser.add_argument("--disable-tls-verify",action="store_false",help="When passed, enables the use of self-signed certificates.",default=None)
parser.add_argument("--disable-tls-verify",action="store_false",help="When passed, enables the use of self-signed certificates.",default=None)
parser.add_argument("--server-name",type=str,help="Sets hostname of server",default=None)
parser.add_argument("--server-name",type=str,help="Sets hostname of server",default=None)
parser.add_argument("--gradio-queue",action='store_true',help="does not do anything",default=True)
parser.add_argument("--gradio-queue",action='store_true',help="does not do anything",default=True)
parser.add_argument("--no-gradio-queue",action='store_true',help="Disables gradio queue; causes the webpage to use http requests instead of websockets; was the defaul in earlier versions")
parser.add_argument("--no-gradio-queue",action='store_true',help="Disables gradio queue; causes the webpage to use http requests instead of websockets; was the default in earlier versions")
parser.add_argument("--skip-version-check",action='store_true',help="Do not check versions of torch and xformers")
parser.add_argument("--skip-version-check",action='store_true',help="Do not check versions of torch and xformers")
parser.add_argument("--no-hashing",action='store_true',help="disable sha256 hashing of checkpoints to help loading performance",default=False)
parser.add_argument("--no-hashing",action='store_true',help="disable sha256 hashing of checkpoints to help loading performance",default=False)
parser.add_argument("--no-download-sd-model",action='store_true',help="don't download SD1.5 model even if no model is found in --ckpt-dir",default=False)
parser.add_argument("--no-download-sd-model",action='store_true',help="don't download SD1.5 model even if no model is found in --ckpt-dir",default=False)
# 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]"
# 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):
# will be represented with prompt_schedule like this (assuming steps=100):
# [25, 'fantasy landscape with a mountain and an oak in foreground shoddy']
# [25, 'fantasy landscape with a mountain and an oak in foreground shoddy']
# [50, 'fantasy landscape with a lake and an oak in foreground in background shoddy']
# [50, 'fantasy landscape with a lake and an oak in foreground in background shoddy']
"save_incomplete_images":OptionInfo(False,"Save incomplete images").info("save images that has been interrupted in mid-generation; even if not saved, they will still show up in webui output."),
"save_incomplete_images":OptionInfo(False,"Save incomplete images").info("save images that has been interrupted in mid-generation; even if not saved, they will still show up in webui output."),
"notification_audio":OptionInfo(True,"Play notification sound after image generation").info("notification.mp3 should be present in the root directory").needs_reload_ui(),
"notification_audio":OptionInfo(True,"Play notification sound after image generation").info("notification.mp3 should be present in the root directory").needs_reload_ui(),
"extra_networks_card_height":OptionInfo(0,"Card height for Extra Networks").info("in pixels"),
"extra_networks_card_height":OptionInfo(0,"Card height for Extra Networks").info("in pixels"),
"extra_networks_card_text_scale":OptionInfo(1.0,"Card text scale",gr.Slider,{"minimum":0.0,"maximum":2.0,"step":0.01}).info("1 = original size"),
"extra_networks_card_text_scale":OptionInfo(1.0,"Card text scale",gr.Slider,{"minimum":0.0,"maximum":2.0,"step":0.01}).info("1 = original size"),
"extra_networks_card_show_desc":OptionInfo(True,"Show description on card"),
"extra_networks_card_show_desc":OptionInfo(True,"Show description on card"),
"extra_networks_card_order_field":OptionInfo("Name","Default order field for Extra Networks cards",gr.Dropdown,{"choices":['Name','Date Created','Date Modified']}).needs_reload_ui(),
"extra_networks_card_order":OptionInfo("Ascending","Default order for Extra Networks cards",gr.Dropdown,{"choices":['Ascending','Descending']}).needs_reload_ui(),
"extra_networks_add_text_separator":OptionInfo(" ","Extra networks separator").info("extra text to add before <...> when adding extra network to prompt"),
"extra_networks_add_text_separator":OptionInfo(" ","Extra networks separator").info("extra text to add before <...> when adding extra network to prompt"),
"txt2img_settings_accordion":OptionInfo(False,"Settings in txt2img hidden under Accordion").needs_reload_ui(),
"txt2img_settings_accordion":OptionInfo(False,"Settings in txt2img hidden under Accordion").needs_reload_ui(),
"img2img_settings_accordion":OptionInfo(False,"Settings in img2img hidden under Accordion").needs_reload_ui(),
"img2img_settings_accordion":OptionInfo(False,"Settings in img2img hidden under Accordion").needs_reload_ui(),
"compact_prompt_box":OptionInfo(False,"Compact prompt layout").info("puts prompt and negative prompt inside the Generate tab, leaving more vertical space for the image on the right").needs_reload_ui(),
"""Creates a top row UI with prompts, generate button, styles, extra little buttons for things, and enables some functionality related to their operation"""
self.prompt=gr.Textbox(label="Prompt",elem_id=f"{id_part}_prompt",show_label=False,lines=3,placeholder="Prompt (press Ctrl+Enter or Alt+Enter to generate)",elem_classes=["prompt"])
self.negative_prompt=gr.Textbox(label="Negative prompt",elem_id=f"{id_part}_neg_prompt",show_label=False,lines=3,placeholder="Negative prompt (press Ctrl+Enter or Alt+Enter to generate)",elem_classes=["prompt"])
self.paste=ToolButton(value=paste_symbol,elem_id="paste",tooltip="Read generation parameters from prompt or last generation if prompt is empty into user interface.")
self.apply_styles=ToolButton(value=ui_prompt_styles.styles_materialize_symbol,elem_id=f"{id_part}_style_apply",tooltip="Apply all selected styles to prompts.")
init_img=gr.Image(label="Image for img2img",elem_id="img2img_image",show_label=False,source="upload",interactive=True,type="pil",tool="editor",image_mode="RGBA",height=opts.img2img_editor_height)
sketch=gr.Image(label="Image for img2img",elem_id="img2img_sketch",show_label=False,source="upload",interactive=True,type="pil",tool="color-sketch",image_mode="RGB",height=opts.img2img_editor_height,brush_color=opts.img2img_sketch_default_brush_color)
init_img=gr.Image(label="Image for img2img",elem_id="img2img_image",show_label=False,source="upload",interactive=True,type="pil",tool="editor",image_mode="RGBA",height=opts.img2img_editor_height)
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",height=opts.img2img_editor_height,brush_color=opts.img2img_inpaint_mask_brush_color)
sketch=gr.Image(label="Image for img2img",elem_id="img2img_sketch",show_label=False,source="upload",interactive=True,type="pil",tool="color-sketch",image_mode="RGB",height=opts.img2img_editor_height,brush_color=opts.img2img_sketch_default_brush_color)
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",height=opts.img2img_editor_height,brush_color=opts.img2img_inpaint_mask_brush_color)
img2img_batch_inpaint_mask_dir=gr.Textbox(label="Inpaint batch mask directory (required for inpaint batch processing only)",**shared.hide_dirs,elem_id="img2img_batch_inpaint_mask_dir")
"<p style='padding-bottom: 1em;' class=\"text-gray-500\">Process images in a directory on the same machine where the server is running."+
withgr.Accordion("PNG info",open=False):
"<br>Use an empty output directory to save pictures normally instead of writing to the output directory."+
img2img_batch_use_png_info=gr.Checkbox(label="Append png info to prompts",**shared.hide_dirs,elem_id="img2img_batch_use_png_info")
f"<br>Add inpaint batch mask directory to enable inpaint batch processing."
img2img_batch_png_info_dir=gr.Textbox(label="PNG info directory",**shared.hide_dirs,placeholder="Leave empty to use input directory",elem_id="img2img_batch_png_info_dir")
f"{hidden}</p>"
img2img_batch_png_info_props=gr.CheckboxGroup(["Prompt","Negative prompt","Seed","CFG scale","Sampler","Steps","Model hash"],label="Parameters to take from png info",info="Prompts from png info will be appended to prompts set in ui.")
img2img_batch_use_png_info=gr.Checkbox(label="Append png info to prompts",**shared.hide_dirs,elem_id="img2img_batch_use_png_info")
img2img_batch_png_info_dir=gr.Textbox(label="PNG info directory",**shared.hide_dirs,placeholder="Leave empty to use input directory",elem_id="img2img_batch_png_info_dir")
defcopy_image(img):
img2img_batch_png_info_props=gr.CheckboxGroup(["Prompt","Negative prompt","Seed","CFG scale","Sampler","Steps","Model hash"],label="Parameters to take from png info",info="Prompts from png info will be appended to prompts set in ui.")
"""Creates a top row UI with prompts, generate button, styles, extra little buttons for things, and enables some functionality related to their operation"""
self.prompt=gr.Textbox(label="Prompt",elem_id=f"{self.id_part}_prompt",show_label=False,lines=3,placeholder="Prompt (press Ctrl+Enter or Alt+Enter to generate)",elem_classes=["prompt"])
self.negative_prompt=gr.Textbox(label="Negative prompt",elem_id=f"{self.id_part}_neg_prompt",show_label=False,lines=3,placeholder="Negative prompt (press Ctrl+Enter or Alt+Enter to generate)",elem_classes=["prompt"])
self.paste=ToolButton(value=paste_symbol,elem_id="paste",tooltip="Read generation parameters from prompt or last generation if prompt is empty into user interface.")
self.apply_styles=ToolButton(value=ui_prompt_styles.styles_materialize_symbol,elem_id=f"{self.id_part}_style_apply",tooltip="Apply all selected styles to prompts.")
ifself.is_img2img:
self.button_interrogate=ToolButton('📎',tooltip='Interrogate CLIP - use CLIP neural network to create a text describing the image, and put it into the prompt field',elem_id="interrogate")
self.button_deepbooru=ToolButton('📦',tooltip='Interrogate DeepBooru - use DeepBooru neural network to create a text describing the image, and put it into the prompt field',elem_id="deepbooru")