-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from P2Enjoy/martinobettucci-patch-1
Martinobettucci patch 1
- Loading branch information
Showing
1 changed file
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,32 @@ | ||
const SP_PROGRESSBAR_LABEL = 'sp_preview' | ||
const SP_GALLERY_LABEL = 'sp_gallery' | ||
const SP_ERROR_LABEL = '#sp_error' | ||
const SP_GALLERY_CHILD = 'sp_gallery_kid'; | ||
const SP_PROGRESS_LABEL = 'sp_progress'; | ||
|
||
function start_smart_process() { | ||
requestProgress('sp'); | ||
gradioApp().querySelector('#sp_error').innerHTML = ''; | ||
return args_to_array(arguments); | ||
rememberGallerySelection(SP_GALLERY_LABEL) | ||
gradioApp().querySelector('#sp_error').innerHTML = '' | ||
var spGalleryElt = gradioApp().getElementById(SP_GALLERY_LABEL) | ||
// set id of first child of spGalleryElt to 'sp_gallery_kid', | ||
// required by AUTOMATIC1111 UI Logic | ||
spGalleryElt.children[0].id = SP_GALLERY_CHILD | ||
var id = randomId(); | ||
requestProgress(id, | ||
gradioApp().getElementById(SP_GALLERY_LABEL), | ||
gradioApp().getElementById(SP_GALLERY_CHILD), | ||
function () { | ||
}, | ||
function (progress) { | ||
gradioApp().getElementById(SP_PROGRESS_LABEL).innerHTML = progress.textinfo | ||
}) | ||
|
||
const argsToArray = args_to_array(arguments); | ||
argsToArray.push(argsToArray[0]) | ||
argsToArray[0] = id; | ||
return argsToArray | ||
} | ||
|
||
onUiUpdate(function () { | ||
check_progressbar('sp', 'sp_progressbar', 'sp_progress_span', '', 'sp_interrupt', 'sp_preview', 'sp_gallery') | ||
}) | ||
onUiUpdate(function(){ | ||
check_gallery(SP_GALLERY_LABEL) | ||
}) |