mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
feat(lora-pool): add external value handling and config update support
- Add `onSetValue` callback to handle external updates like workflow loading - Implement `updateConfig` method for direct widget value updates - Add value change detection in `restoreFromConfig` to prevent unnecessary updates - Remove debug console log on component mount - Extend widget value type to support legacy config format
This commit is contained in:
@@ -76,8 +76,6 @@ const openModal = (modal: ModalType) => {
|
||||
|
||||
// Lifecycle
|
||||
onMounted(async () => {
|
||||
console.log('[LoraPoolWidget] Mounted, node ID:', props.node.id)
|
||||
|
||||
// Setup serialization
|
||||
props.widget.serializeValue = async () => {
|
||||
const config = state.buildConfig()
|
||||
@@ -85,6 +83,12 @@ onMounted(async () => {
|
||||
return config
|
||||
}
|
||||
|
||||
// Handle external value updates (e.g., loading workflow, paste)
|
||||
props.widget.onSetValue = (v) => {
|
||||
state.restoreFromConfig(v)
|
||||
state.refreshPreview()
|
||||
}
|
||||
|
||||
// Restore from saved value
|
||||
if (props.widget.value) {
|
||||
console.log('[LoraPoolWidget] Restoring from saved value:', props.widget.value)
|
||||
|
||||
Reference in New Issue
Block a user