-
Notifications
You must be signed in to change notification settings - Fork 492
Feat/3d dropdown #8765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/3d dropdown #8765
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import { computed, provide, ref, toRef, watch } from 'vue' | |
| import { useI18n } from 'vue-i18n' | ||
|
|
||
| import { useTransformCompatOverlayProps } from '@/composables/useTransformCompatOverlayProps' | ||
| import { SUPPORTED_EXTENSIONS_ACCEPT } from '@/extensions/core/load3d/constants' | ||
| import { useAssetFilterOptions } from '@/platform/assets/composables/useAssetFilterOptions' | ||
| import { | ||
| filterItemByBaseModels, | ||
|
|
@@ -44,6 +45,7 @@ interface Props { | |
| assetKind?: AssetKind | ||
| allowUpload?: boolean | ||
| uploadFolder?: ResultItemType | ||
| uploadSubfolder?: string | ||
| isAssetMode?: boolean | ||
| defaultLayoutMode?: LayoutMode | ||
| } | ||
|
|
@@ -143,7 +145,7 @@ const inputItems = computed<FormDropdownItem[]>(() => { | |
| })) | ||
| }) | ||
| const outputItems = computed<FormDropdownItem[]>(() => { | ||
| if (!['image', 'video'].includes(props.assetKind ?? '')) return [] | ||
| if (!['image', 'video', 'mesh'].includes(props.assetKind ?? '')) return [] | ||
|
|
||
| const outputs = new Set<string>() | ||
|
|
||
|
|
@@ -152,7 +154,8 @@ const outputItems = computed<FormDropdownItem[]>(() => { | |
| task.flatOutputs.forEach((output) => { | ||
| const isTargetType = | ||
| (props.assetKind === 'image' && output.mediaType === 'images') || | ||
| (props.assetKind === 'video' && output.mediaType === 'video') | ||
| (props.assetKind === 'video' && output.mediaType === 'video') || | ||
| (props.assetKind === 'mesh' && output.is3D) | ||
|
|
||
| if (output.type === 'output' && isTargetType) { | ||
| const path = output.subfolder | ||
|
|
@@ -292,6 +295,8 @@ const mediaPlaceholder = computed(() => { | |
| return t('widgets.uploadSelect.placeholderVideo') | ||
| case 'audio': | ||
| return t('widgets.uploadSelect.placeholderAudio') | ||
| case 'mesh': | ||
| return t('widgets.uploadSelect.placeholderMesh') | ||
|
Comment on lines
+298
to
+299
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n 'placeholderMesh' src/locales/Repository: Comfy-Org/ComfyUI_frontend Length of output: 52 🏁 Script executed: rg -A 2 -B 2 'uploadSelect' src/locales/en/main.jsonRepository: Comfy-Org/ComfyUI_frontend Length of output: 239 Add missing i18n key The key referenced in the code does not exist in the locale file. The uploadSelect section currently only contains 🤖 Prompt for AI Agents |
||
| case 'model': | ||
| return t('widgets.uploadSelect.placeholderModel') | ||
| case 'unknown': | ||
|
|
@@ -316,6 +321,8 @@ const acceptTypes = computed(() => { | |
| return 'video/*' | ||
| case 'audio': | ||
| return 'audio/*' | ||
| case 'mesh': | ||
| return SUPPORTED_EXTENSIONS_ACCEPT | ||
jtydhr88 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| default: | ||
| return undefined // model or unknown | ||
| } | ||
|
|
@@ -365,6 +372,8 @@ const uploadFile = async ( | |
| const body = new FormData() | ||
| body.append('image', file) | ||
| if (isPasted) body.append('subfolder', 'pasted') | ||
| else if (props.uploadSubfolder) | ||
| body.append('subfolder', props.uploadSubfolder) | ||
jtydhr88 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (formFields.type) body.append('type', formFields.type) | ||
|
|
||
| const resp = await api.fetchApi('/upload/image', { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love that we have a magic suffix...
(Not introduced in this PR, just noting)