Comfy-Org / Comfy-Org/ComfyUI_frontend

Centralize upload helper functions into shared utility

Open
#8,130 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Context

Multiple upload helper implementations are duplicated across the codebase, making it difficult to maintain and refactor upload logic consistently.

## Locations with duplicated upload functionality

- `src/composables/node/useNodeImageUpload.ts:20-49` (most generic implementation)
- `src/composables/maskeditor/useMaskEditorSaver.ts:266-299`
- `src/components/common/BackgroundImageUpload.vue:55-74`
- `src/extensions/core/webcamCapture.ts`
- `src/extensions/core/uploadAudio.ts:28-73`
- `src/services/audioService.ts`
- `src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue`

## Proposal

Centralize these implementations into a single shared utility or service that all modules can import from. This will:
- Reduce code duplication
- Make future changes to upload logic easier to maintain
- Ensure consistent behavior across all upload operations
- Simplify testing and error handling

## References

- Identified in PR #8129: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8129
- Comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8129#discussion_r2701437891
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-8130-Centralize-upload-helper-functions-into-shared-utility-2eb6d73d365081adaa41c7c77fc11ceb) by [Unito](https://www.unito.io)

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.