Comfy-Org / Comfy-Org/ComfyUI_frontend

Cloud input mapping widget: re-apply default after lazy inputAssets hydration

Open
#12,564 1 comment 1 reaction 1 assignee Claimed by @jaeone94 View on GitHub
area:widgets enhancement
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

When a Cloud input-mapping widget (LoadImage / LoadVideo / LoadAudio) is created and `inputAssets` are not yet populated, `resolveCloudInputDefault()` is evaluated **before** `createInputMappingWidget()` kicks off `updateInputs()`. This means a valid `inputSpec.default` (or first matching cloud asset) is missed on first render, and the widget stays `''` even after the fetch populates the cloud inputs.

## Context

Intentionally deferred in PR #12562 (see [review comment](https://github.com/Comfy-Org/ComfyUI_frontend/pull/12562#discussion_r3332819680)).

Re-applying the default after `updateInputs()` resolves requires a dedicated UX policy covering:
- distinguishing a user-cleared value from an uninitialized one
- parity with existing cloud model asset-widget behavior
- avoiding unintended auto-selection after a user has already interacted with the widget

## Suggested Approach

Inside `createInputMappingWidget`, after `updateInputs()` resolves, re-run `resolveCloudInputDefault(node.comfyClass, inputSpec.default)` and apply that value to the widget **only if** the current widget value is still empty/`''`.

## Requester

@jaeone94

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.