├── README.md └── javascript └── SDAtom-WebUi-us.user.js /README.md: -------------------------------------------------------------------------------- 1 | # Queue extension for [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 2 | 3 | This is the extension version of the [SDAtom-WebUi-us](https://github.com/Kryptortio/SDAtom-WebUi-us) (user script) repo. 4 | 5 | **👉 For documentation, reporting issues etc check out the** [**original repo**](https://github.com/Kryptortio/SDAtom-WebUi-us). 6 | 7 | ![alt text](https://github.com/Kryptortio/SDAtom-WebUi-us/blob/main/screenshot.png?raw=true) 8 | 9 | # Issues 10 | 11 | It's a good idea to first check [the troubleshooting section.](https://github.com/Kryptortio/SDAtom-WebUi-us#troubleshooting) 12 | 13 | Any issues with this script should be reported [in the main repo](https://github.com/Kryptortio/SDAtom-WebUi-us). 14 | 15 | # Installation 16 | 17 | Open the webui and go to the **Extensions** tab, you can find the extension under **Available** > **Web UI client queue**. You can also use **Install from URL** and enter the url to this repo (https://github.com/Kryptortio/SDAtom-WebUi-client-queue-ext) and then click install. 18 | 19 | Alternatively you can [download it](https://github.com/Kryptortio/SDAtom-WebUi-client-queue-ext/archive/refs/heads/main.zip) manually and put it in the extensions folder. The file should be placed under \stable-diffusion-webui\extensions\SDAtom-WebUi-client-queue-ext\javascript\SDAtom-WebUi-us.user.js 20 | 21 | To **update** an extension you have to manually go to the **Extensions** tab click the **Check for updates** button and then **Apply and restart UI**. 22 | -------------------------------------------------------------------------------- /javascript/SDAtom-WebUi-us.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name SDAtom-WebUi-us 3 | // @namespace SDAtom-WebUi-us 4 | // @version 1.4.1 5 | // @description Queue for AUTOMATIC1111 WebUi and an option to saving settings 6 | // @author Kryptortio 7 | // @homepage https://github.com/Kryptortio/SDAtom-WebUi-us 8 | // @match http://127.0.0.1:7860/* 9 | // @updateURL https://raw.githubusercontent.com/Kryptortio/SDAtom-WebUi-us/main/SDAtom-WebUi-us.user.js 10 | // @downloadURL https://raw.githubusercontent.com/Kryptortio/SDAtom-WebUi-us/main/SDAtom-WebUi-us.user.js 11 | // @grant none 12 | // ==/UserScript== 13 | (function() { 14 | 'use strict'; 15 | 16 | const c_scriptVersion = typeof GM_info == 'undefined' ? '1.3.2' : GM_info.script.version; 17 | const c_scriptHandeler = typeof GM_info == 'undefined' ? '(not user script)' : GM_info.scriptHandler; 18 | 19 | // ----------------------------------------------------------------------------- Config 20 | let conf = { 21 | shadowDOM:{sel:"gradio-app"}, 22 | commonData: { 23 | t2iContainer:{sel:"#tab_txt2img"}, 24 | i2iContainer:{sel:"#tab_img2img"}, 25 | extContainer:{sel:"#tab_extras"}, 26 | sdModelCheckpoint:{grad:"setting_sd_model_checkpoint"}, 27 | versionContainer:{sel:"#footer .versions"}, 28 | 29 | working:false, 30 | processing:false, 31 | waiting:false, 32 | }, 33 | t2i: { 34 | controls:{ 35 | tabButton: {sel:"#tabs > div:nth-child(1) > button:nth-child(1)"}, 36 | genrateButton: {sel:"#txt2img_generate"}, 37 | skipButton: {sel:"#txt2img_skip"}, 38 | }, 39 | 40 | prompt: {sel:"#txt2img_prompt textarea"}, 41 | negPrompt: {sel:"#txt2img_neg_prompt textarea"}, 42 | 43 | sample: {sel:"#txt2img_steps [id^=range_id]",sel2:"#txt2img_steps input"}, 44 | sampleMethod: {grad:"txt2img_sampling"}, 45 | 46 | width: {sel:"#txt2img_width [id^=range_id]",sel2:"#txt2img_width input"}, 47 | height: {sel:"#txt2img_height [id^=range_id]",sel2:"#txt2img_height input"}, 48 | 49 | restoreFace: {sel:"#txt2img_settings #setting_face_restoration input"}, 50 | tiling: {sel:"#txt2img_settings #setting_tiling input"}, 51 | 52 | highresFix: {sel:"#txt2img_hr"}, 53 | hrFixUpscaler: {grad:"txt2img_hr_upscaler"}, 54 | hrFixSteps: {sel:"#txt2img_hires_steps [id^=range_id]",sel2:"#txt2img_hires_steps input"}, 55 | hrFixdenoise: {sel:"#txt2img_denoising_strength [id^=range_id]",sel2:"#txt2img_denoising_strength input"}, 56 | hrFixUpscaleBy: {sel:"#txt2img_hr_scale [id^=range_id]",sel2:"#txt2img_hr_scale input"}, 57 | hrFixWidth: {sel:"#txt2img_hr_resize_x [id^=range_id]",sel2:"#txt2img_hr_resize_x input"}, 58 | hrFixHeight: {sel:"#txt2img_hr_resize_y [id^=range_id]",sel2:"#txt2img_hr_resize_y input"}, 59 | 60 | batchCount: {sel:"#txt2img_batch_count [id^=range_id]",sel2:"#txt2img_batch_count input"}, 61 | batchSize: {sel:"#txt2img_batch_size [id^=range_id]",sel2:"#txt2img_batch_size input"}, 62 | 63 | cfg: {sel:"#txt2img_cfg_scale [id^=range_id]",se2:"#txt2img_cfg_scale input"}, 64 | 65 | seed: {sel:"#txt2img_seed input"}, 66 | 67 | extra: {sel:"#txt2img_subseed_show input"}, 68 | varSeed: {sel:"#txt2img_subseed input"}, 69 | varStr: {sel:"#txt2img_subseed_strength [id^=range_id]",sel2:"#txt2img_subseed_strength input"}, 70 | varRSFWidth: {sel:"#txt2img_seed_resize_from_w [id^=range_id]",sel2:"#txt2img_seed_resize_from_w input"}, 71 | varRSFHeight: {sel:"#txt2img_seed_resize_from_h [id^=range_id]",sel2:"#txt2img_seed_resize_from_h input"}, 72 | 73 | script: {grad:"script_list",gradIndex:0}, 74 | 75 | scriptPromptMatrixPutVar: {sel:"#script_txt2img_prompt_matrix_put_at_start input"}, 76 | scriptPromptMatrixUseDiff: {sel:"#script_txt2img_prompt_matrix_different_seeds input"}, 77 | 78 | scriptXYZXtype:{grad:"script_txt2img_xyz_plot_x_type"}, 79 | scriptXYZXVals:{sel:"#script_txt2img_xyz_plot_x_values textarea"}, 80 | scriptXYZYtype:{grad:"script_txt2img_xyz_plot_y_type"}, 81 | scriptXYZYVals:{sel:"#script_txt2img_xyz_plot_y_values textarea"}, 82 | scriptXYZZtype:{grad:"script_txt2img_xyz_plot_z_type"}, 83 | scriptXYZZVals:{sel:"#script_txt2img_xyz_plot_z_values textarea"}, 84 | scriptXYZDrawLeg:{sel:"#script_txt2img_xyz_plot_draw_legend input"}, 85 | scriptXYZIncludeSubImg:{sel:"#script_txt2img_xyz_plot_include_lone_images input"}, 86 | scriptXYZIncludeSubGrid:{sel:"#script_txt2img_xyz_plot_include_sub_grids input"}, 87 | scriptXYZKeepMOne:{sel:"#script_txt2img_xyz_plot_no_fixed_seeds input"}, 88 | scriptXYZGridMargin: {sel:"#script_txt2img_xyz_plot_margin_size [id^=range_id]",sel2:"#script_txt2img_xyz_plot_margin_size input"}, 89 | }, 90 | i2i:{ 91 | controls:{ 92 | tabButton: {sel:"#tabs > div:nth-child(1) > button:nth-child(2)"}, 93 | genrateButton: {sel:"#img2img_generate"}, 94 | skipButton: {sel:"#img2img_skip"}, 95 | i2iMode:[ 96 | {name:"i2i", buttonSel:"#mode_img2img button:nth-child(1)", containerSel:"#img2img_img2img_tab"}, 97 | {name:"sketch", buttonSel:"#mode_img2img button:nth-child(2)", containerSel:"#img2img_img2img_sketch_tab"}, 98 | {name:"inpaint", buttonSel:"#mode_img2img button:nth-child(3)", containerSel:"#img2img_inpaint_tab"}, 99 | {name:"inpaintSketch", buttonSel:"#mode_img2img button:nth-child(4)", containerSel:"#img2img_inpaint_sketch_tab"}, 100 | {name:"inpaintUpload", buttonSel:"#mode_img2img button:nth-child(5)", containerSel:"#img2img_inpaint_upload_tab"}, 101 | {name:"batch", buttonSel:"#mode_img2img button:nth-child(6)", containerSel:"#img2img_batch_tab"}, 102 | ], 103 | }, 104 | 105 | prompt: {sel:"#img2img_prompt textarea"}, 106 | negPrompt: {sel:"#img2img_neg_prompt textarea"}, 107 | 108 | resizeMode: {sel:"#resize_mode"}, 109 | 110 | inpaintBlur: {sel:"#img2img_mask_blur [id^=range_id]",sel2:"#img2img_mask_blur"}, 111 | inpaintMaskMode: {sel:"#img2img_mask_mode"}, 112 | inpaintMaskContent: {sel:"#img2img_inpainting_fill"}, 113 | inpaintArea: {sel:"#img2img_inpaint_full_res"}, 114 | inpaintPadding: {sel:"#img2img_inpaint_full_res_padding [id^=range_id]",sel2:"#img2img_inpaint_full_res_padding"}, 115 | 116 | 117 | i2iBatchInputDir: {sel:"#img2img_batch_input_dir textarea"}, 118 | i2iBatchOutputDir: {sel:"#img2img_batch_output_dir textarea"}, 119 | i2iBatchMaskDir: {sel:"#img2img_batch_inpaint_mask_dir textarea"}, 120 | 121 | sample: {sel:"#img2img_steps [id^=range_id]",sel2:"#img2img_steps input"}, 122 | sampleMethod: {grad:"img2img_sampling"}, 123 | 124 | width: {sel:"#img2img_width [id^=range_id]",sel2:"#img2img_width input"}, 125 | height: {sel:"#img2img_height [id^=range_id]",sel2:"#img2img_height input"}, 126 | 127 | restoreFace: {sel:"#img2img_settings #setting_face_restoration input"}, 128 | tiling: {sel:"#img2img_settings #setting_tiling input"}, 129 | 130 | batchCount: {sel:"#img2img_batch_count [id^=range_id]",sel2:"#img2img_batch_count input"}, 131 | batchSize: {sel:"#img2img_batch_size [id^=range_id]",sel2:"#img2img_batch_size input"}, 132 | 133 | cfg: {sel:"#img2img_cfg_scale [id^=range_id]",se2:"#img2img_cfg_scale input"}, 134 | 135 | denoise: {sel:"#img2img_denoising_strength [id^=range_id]",se2:"#img2img_denoising_strength input"}, 136 | 137 | seed: {sel:"#img2img_seed input"}, 138 | 139 | extra: {sel:"#txt2img_subseed_show input"}, 140 | varSeed: {sel:"#img2img_subseed input"}, 141 | varStr: {sel:"#img2img_subseed_strength input",sel2:"#img2img_subseed_strength [id^=range_id]"}, 142 | varRSFWidth: {sel:"#img2img_seed_resize_from_w input",sel2:"#img2img_seed_resize_from_w [id^=range_id]"}, 143 | varRSFHeight: {sel:"#img2img_seed_resize_from_h input",sel2:"#img2img_seed_resize_from_h [id^=range_id]"}, 144 | 145 | script: {grad:"script_list",gradIndex:1}, 146 | 147 | scriptPromptMatrixPutVar: {sel:"#script_img2img_prompt_matrix_put_at_start input"}, 148 | scriptPromptMatrixUseDiff: {sel:"#script_img2img_prompt_matrix_different_seeds input"}, 149 | 150 | scriptXYZXtype:{grad:"script_img2img_xyz_plot_x_type"}, 151 | scriptXYZXVals:{sel:"#script_img2img_xyz_plot_x_values textarea"}, 152 | scriptXYZYtype:{grad:"script_img2img_xyz_plot_y_type"}, 153 | scriptXYZYVals:{sel:"#script_img2img_xyz_plot_y_values textarea"}, 154 | scriptXYZZtype:{grad:"script_img2img_xyz_plot_z_type"}, 155 | scriptXYZZVals:{sel:"#script_img2img_xyz_plot_z_values textarea"}, 156 | scriptXYZDrawLeg:{sel:"#script_img2img_xyz_plot_draw_legend input"}, 157 | scriptXYZIncludeSubImg:{sel:"#script_img2img_xyz_plot_include_lone_images input"}, 158 | scriptXYZIncludeSubGrid:{sel:"#script_img2img_xyz_plot_include_sub_grids input"}, 159 | scriptXYZKeepMOne:{sel:"#script_img2img_xyz_plot_no_fixed_seeds input"}, 160 | scriptXYZGridMargin: {sel:"#script_img2img_xyz_plot_margin_size [id^=range_id]",sel2:"#script_img2img_xyz_plot_margin_size input"}, 161 | 162 | scripti2iAltTestOverrideSampM:{sel:"#script_img2img_alternative_test_override_sampler input"}, 163 | scripti2iAltTestOverrideProm:{sel:"#script_img2img_alternative_test_override_prompt input"}, 164 | scripti2iAltTestOrigProm:{sel:"#script_img2img_alternative_test_original_prompt textarea"}, 165 | scripti2iAltTestOrigNProm:{sel:"#script_img2img_alternative_test_original_negative_prompt textarea"}, 166 | scripti2iAltTestOverrideSampS:{sel:"#script_img2img_alternative_test_override_steps input"}, 167 | scripti2iAltTestDecStep:{sel:"#script_img2img_alternative_test_st input",sel2:"#script_img2img_alternative_test_st [id^=range_id]"}, 168 | scripti2iAltTestOverrideDenoi:{sel:"#script_img2img_alternative_test_override_strength input"}, 169 | scripti2iAltTestDecCFG:{sel:"#script_img2img_alternative_test_cfg input",sel2:"#script_img2img_alternative_test_cfg [id^=range_id]"}, 170 | scripti2iAltTestRand:{sel:"#script_img2img_alternative_test_randomness input",sel2:"#script_img2img_alternative_test_randomness [id^=range_id]"}, 171 | scripti2iAltTestSigma:{sel:"#script_img2img_alternative_test_sigma_adjustment input"}, 172 | 173 | scriptLoopbackLoops:{sel:"#script_loopback_loops input",sel2:"#script_loopback_loops [id^=range_id]"}, 174 | scriptLoopbackDenoStr:{sel:"#script_loopback_final_denoising_strength input",sel2:"#script_loopback_final_denoising_strength [id^=range_id]"}, 175 | scriptLoopbackDenoStrCurve:{gradLab:"Denoising strength curve"}, 176 | scriptLoopbackAppend:{gradLab:"Append interrogated prompt at each iteration"}, 177 | 178 | scriptOutPMK2Pixels:{sel:"#script_outpainting_mk2_pixels input",sel2:"#script_outpainting_mk2_pixels [id^=range_id]"}, 179 | scriptOutPMK2MaskBlur:{sel:"#script_outpainting_mk2_mask_blur input",sel2:"#script_outpainting_mk2_mask_blur [id^=range_id]"}, 180 | scriptOutPMK2Left:{sel:"#script_outpainting_mk2_direction label:nth-child(1) input"}, 181 | scriptOutPMK2Right:{sel:"#script_outpainting_mk2_direction label:nth-child(2) input"}, 182 | scriptOutPMK2Up:{sel:"#script_outpainting_mk2_direction label:nth-child(3) input"}, 183 | scriptOutPMK2Down:{sel:"#script_outpainting_mk2_direction label:nth-child(4) input"}, 184 | scriptOutPMK2FallOff:{sel:"#script_outpainting_mk2_noise_q input",sel2:"#script_outpainting_mk2_noise_q [id^=range_id]"}, 185 | scriptOutPMK2ColorVar:{sel:"#script_outpainting_mk2_color_variation input",sel2:"#script_outpainting_mk2_color_variation [id^=range_id]"}, 186 | 187 | scriptPoorManPixels:{sel:"#script_poor_mans_outpainting_pixels input",sel2:"#script_poor_mans_outpainting_pixels [id^=range_id]"}, 188 | scriptPoorManMaskBlur:{sel:"#script_poor_mans_outpainting_mask_blur input",sel2:"#script_poor_mans_outpainting_mask_blur [id^=range_id]"}, 189 | scriptPoorManMaskCont:{sel:"#script_poor_mans_outpainting_inpainting_fill"}, 190 | scriptPoorManLeft:{sel:"#script_poor_mans_outpainting_direction label:nth-child(1) input"}, 191 | scriptPoorManRight:{sel:"#script_poor_mans_outpainting_direction label:nth-child(2) input"}, 192 | scriptPoorManUp:{sel:"#script_poor_mans_outpainting_direction label:nth-child(3) input"}, 193 | scriptPoorManDown:{sel:"#script_poor_mans_outpainting_direction label:nth-child(4) input"}, 194 | 195 | scriptSDUpTile:{sel:"#script_sd_upscale_overlap input",sel2:"#script_sd_upscale_overlap [id^=range_id]"}, 196 | scriptSDUpScale:{sel:"#script_sd_upscale_scale_factor input",sel2:"#script_sd_upscale_scale_factor [id^=range_id]"}, 197 | scriptSDUpUpcaler:{sel:"#script_sd_upscale_upscaler_index"}, 198 | 199 | }, 200 | ext:{ 201 | controls:{ 202 | tabButton: {sel:"#tabs > div:nth-child(1) > button:nth-child(3)"}, 203 | genrateButton: {sel:"#extras_generate"}, 204 | loadingElement:{sel:"#html_info_x_extras .wrap"}, 205 | extrasResizeMode:[ 206 | {name:"scaleBy",buttonSel:"#extras_resize_mode button:nth-child(1)",containerSel:"#extras_scale_by_tab"}, 207 | {name:"scaleTo",buttonSel:"#extras_resize_mode button:nth-child(2)",containerSel:"#extras_scale_to_tab"}, 208 | ], 209 | extrasMode:[ 210 | {name:"singleImg",buttonSel:"#mode_extras button:nth-child(1)",containerSel:"#extras_single_tab"}, 211 | {name:"batchProcess",buttonSel:"#mode_extras button:nth-child(2)",containerSel:"#extras_batch_process_tab"}, 212 | {name:"batchDir",buttonSel:"#mode_extras button:nth-child(3)",containerSel:"#extras_batch_directory_tab"}, 213 | ], 214 | }, 215 | 216 | 217 | scaleByResize:{sel:"#extras_upscaling_resize input",sel2:"#extras_upscaling_resize [id^=range_id]"}, 218 | 219 | scaleToWidth:{sel:"#extras_upscaling_resize_w input"}, 220 | scaleToHeight:{sel:"#extras_upscaling_resize_h input"}, 221 | scaleToCropToFit:{sel:"#extras_upscaling_crop input"}, 222 | 223 | batchDirInput:{sel:"#extras_batch_input_dir textarea"}, 224 | batchDirOutput:{sel:"#extras_batch_output_dir textarea"}, 225 | batchDirShowImg:{sel:"#extras_show_extras_results input"}, 226 | 227 | upscaler1:{grad:"extras_upscaler_1"}, 228 | upscaler2:{grad:"extras_upscaler_2"}, 229 | upscale2Vis:{sel:"#extras_upscaler_2_visibility input",sel2:"#extras_upscaler_2_visibility [id^=range_id]"}, 230 | GFPGANVis:{sel:"#extras_gfpgan_visibility input",sel2:"#extras_gfpgan_visibility [id^=range_id]"}, 231 | CodeFormVis:{sel:"#extras_codeformer_visibility input",sel2:"#extras_codeformer_visibility [id^=range_id]"}, 232 | CodeFormWeight:{sel:"#extras_codeformer_weight input",sel2:"#extras_codeformer_weight [id^=range_id]"}, 233 | 234 | 235 | }, 236 | extensions: { 237 | iBrowser: { 238 | name:"stable-diffusion-webui-images-browser", 239 | existCheck:{sel:"#tab_image_browser"}, 240 | guiElems: { 241 | iBrowserContainer:{sel:"#tab_image_browser"}, 242 | generationInfo: {sel: "#image_browser_tab_txt2img_image_browser_file_info textarea"}, 243 | 244 | txt2img:{sel:'#image_browser_tab_txt2img_image_browser_file_info textarea'}, 245 | img2img:{sel:'#image_browser_tab_img2img_image_browser_file_info textarea'}, 246 | txt2imgG:{sel:'#image_browser_tab_txt2img-grids_image_browser_file_info textarea'}, 247 | img2imgG:{sel:'#image_browser_tab_img2img-grids_image_browser_file_info textarea'}, 248 | extras:{sel:'#image_browser_tab_extras_image_browser_file_info textarea'}, 249 | favorites:{sel:'#image_browser_tab_favorites_image_browser_file_info textarea'}, 250 | }, 251 | ui:{}, 252 | text:{ 253 | queueVariationsButtonText:'Add 5 variations', 254 | queueHiResVersionButtonText:'Add HiRes version', 255 | }, 256 | functions: { 257 | getValueJSON: function () { 258 | awqLog('iBrowser.getValueJSON: parsing data'); 259 | let valueJSON = {type:'t2i'}; 260 | 261 | let currentTab = document.querySelector('#image_browser_tabs_container button.selected').innerHTML; 262 | currentTab = currentTab.replace(/\s/g,''); 263 | currentTab = currentTab.replace('-grids','G').toLowerCase(); 264 | 265 | let generationInfoValue = conf.extensions.iBrowser.guiElems[currentTab].el.value; 266 | 267 | //Used when loading prompt from image browser 268 | /* 269 | Kind of using the logic from generation_parameters_copypaste.py/parse_generation_parameters (but not really, because that doesn't account for Template/Negative Template) 270 | Structure 271 | 272 | Negative prompt: 273 | a1: b1, a2: b2, etc 274 | Template: