load description to input box by clicking on card(except checkpoint)

This commit is contained in:
Miao Xiang
2023-04-01 18:16:23 -07:00
parent 62a9a9cbe9
commit bd8d3f1692
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -74,9 +74,15 @@ function tryToRemoveExtraNetworkFromPrompt(textarea, text){
return false
}
function cardClicked(tabname, textToAdd, allowNegativePrompt){
function cardClicked(tabname, textToAdd, allowNegativePrompt, descriptionText){
var textarea = allowNegativePrompt ? activePromptTextarea[tabname] : gradioApp().querySelector("#" + tabname + "_prompt > label > textarea")
var description_textarea = gradioApp().querySelector("#" + tabname+ '_description_input > label > textarea')
description_textarea.value = descriptionText
updateInput(description_textarea)
if(! tryToRemoveExtraNetworkFromPrompt(textarea, textToAdd)){
textarea.value = textarea.value + opts.extra_networks_add_text_separator + textToAdd
}