Skip to content

About the right click "send to txt2img" function #384

Answered by zanllp
rayadaschn asked this question in Q&A
Discussion options

You must be logged in to vote

BroadcastChannel + Click the hidden button

const imgTransferBus = new BroadcastChannel('iib-image-transfer-bus')
imgTransferBus.addEventListener('message', async (ev) => {
const data = JSON.parse(ev.data)
if (typeof data !== 'object') {
return
}
console.log(`iib-message:`, data)
const appDoc = gradioApp()
switch (data.event) {
case 'click_hidden_button': {
const btn = gradioApp().querySelector(`#${data.btnEleId}`)
btn.click()
break
}
case 'send_to_control_net': {
data.type === 'img2img' ? window.switch_to_img2img() : window.s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zanllp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants