Skip to content

Commit

Permalink
fixbug
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowcz007 committed Aug 26, 2024
1 parent 7277844 commit a66023a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions web/javascript/3d_mixlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,20 @@ app.registerExtension({
}
},

async init(){
await loadExternalScript(
'/mixlab/app/lib/model-viewer.min.js',
'module'
)
},

async beforeRegisterNodeDef (nodeType, nodeData, app) {
if (nodeType.comfyClass == '3DImage') {
console.log("nodeType.comfyClass",nodeType.comfyClass)
const orig_nodeCreated = nodeType.prototype.onNodeCreated
nodeType.prototype.onNodeCreated = async function () {
await loadExternalScript(
'/mixlab/app/lib/model-viewer.min.js',
'module'
)

orig_nodeCreated?.apply(this, arguments)

const uploadWidget = this.widgets.filter(w => w.name == 'upload')[0]

const widget = {
type: 'div',
name: 'upload-preview',
Expand All @@ -293,7 +294,6 @@ app.registerExtension({

widget.div = $el('div', {})
widget.div.style.width = `120px`

document.body.appendChild(widget.div)

const inputDiv = (key, placeholder, preview) => {
Expand Down

0 comments on commit a66023a

Please sign in to comment.