fix bug: controlnet won't generate detection map when paired with script
parent
4f07cea4e5
commit
20c891cb92
|
|
@ -30,5 +30,5 @@ original_mask.png
|
|||
|
||||
|
||||
# comments when packaging:
|
||||
|
||||
ultimate_sd_upscaler/dist/*LICENSE.txt
|
||||
ultimate_sd_upscaler/dist/*.bundle.js
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -32,6 +32,7 @@
|
|||
"nodemon": "^2.0.22",
|
||||
"prettier": "2.8.3",
|
||||
"style-loader": "^3.3.2",
|
||||
"terser-webpack-plugin": "^3.0.8",
|
||||
"ts-loader": "^9.4.2",
|
||||
"typescript": "^5.0.4",
|
||||
"webpack": "^5.82.1",
|
||||
|
|
@ -40,10 +41,7 @@
|
|||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "cd ultimate_sd_upscaler && npx webpack --config webpack.config.js",
|
||||
|
||||
"watch": "cd ultimate_sd_upscaler && npx webpack --config webpack.config.js --watch"
|
||||
|
||||
|
||||
"watch": "cd ultimate_sd_upscaler && npx webpack --config webpack.config.js --watch"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
@ -54,4 +52,4 @@
|
|||
"url": "https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin/issues"
|
||||
},
|
||||
"homepage": "https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin#readme"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -603,7 +603,12 @@ async function requestControlNetTxt2Img(plugin_settings) {
|
|||
app.showAlert('you need to select a valid ControlNet Module')
|
||||
throw 'you need to select a valid ControlNet Module'
|
||||
}
|
||||
if (!control_net_settings['controlnet_units'][index]['model'] && !control_net.getModuleDetail()[control_net_settings['controlnet_units'][index]['module']].model_free) {
|
||||
if (
|
||||
!control_net_settings['controlnet_units'][index]['model'] &&
|
||||
!control_net.getModuleDetail()[
|
||||
control_net_settings['controlnet_units'][index]['module']
|
||||
].model_free
|
||||
) {
|
||||
app.showAlert('you need to select a valid ControlNet Model')
|
||||
throw 'you need to select a valid ControlNet Model'
|
||||
}
|
||||
|
|
@ -684,7 +689,12 @@ async function requestControlNetImg2Img(plugin_settings) {
|
|||
app.showAlert('you need to select a valid ControlNet Module')
|
||||
throw 'you need to select a valid ControlNet Module'
|
||||
}
|
||||
if (!control_net_settings['controlnet_units'][index]['model'] && !control_net.getModuleDetail()[control_net_settings['controlnet_units'][index]['module']].model_free) {
|
||||
if (
|
||||
!control_net_settings['controlnet_units'][index]['model'] &&
|
||||
!control_net.getModuleDetail()[
|
||||
control_net_settings['controlnet_units'][index]['module']
|
||||
].model_free
|
||||
) {
|
||||
app.showAlert('you need to select a valid ControlNet Model')
|
||||
throw 'you need to select a valid ControlNet Model'
|
||||
}
|
||||
|
|
@ -709,6 +719,15 @@ async function requestControlNetImg2Img(plugin_settings) {
|
|||
numOfImages - g_generation_session.last_settings.batch_size
|
||||
if (numberOfAnnotations < 0) numberOfAnnotations = 0
|
||||
|
||||
// To fix a bug: when Ultimate SD Upscale is active and running, the detection maps won’t be retrieved.
|
||||
// So set its value to 0 to avoid the result images being loaded in the annotation map interface.
|
||||
if (
|
||||
scripts.script_store.is_active &&
|
||||
scripts.script_store.selected_script_name !== 'None' &&
|
||||
scripts.script_store.is_selected_script_available
|
||||
) {
|
||||
numberOfAnnotations = 0
|
||||
}
|
||||
const base64_mask = json['images'].slice(numOfImages - numberOfAnnotations)
|
||||
|
||||
let mask_index = 0
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ module.exports = {
|
|||
filename: '[name].bundle.js',
|
||||
libraryTarget: 'commonjs2',
|
||||
},
|
||||
mode: 'development',
|
||||
// mode: 'development',
|
||||
mode: 'production',
|
||||
devtool: 'inline-source-map', // won't work on XD due to lack of eval
|
||||
externals: {
|
||||
uxp: 'commonjs2 uxp',
|
||||
|
|
|
|||
Loading…
Reference in New Issue