mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-18 22:10:03 +00:00
## Summary Addresses UI/UX feedback on the Upload Model Dialog (BYOM feature). ## Changes 1. **Standardize link styling** - Use consistent `text-muted-foreground underline` for all links in both URL input variants 2. **Increase warning/example text font size** - Changed from 12px (`text-xs`) to 14px (`text-sm`) for better readability 3. **Fix padding inconsistency** - Aligned padding between model name box and SingleSelect dropdown; moved "Not sure?" help text inline with the label 4. **Add "Upload Another" button** - Allows users to upload multiple models without closing and reopening the dialog ## Testing - Verified link styling consistency across both Civitai and generic URL input components - Confirmed padding alignment in confirmation step - Tested Upload Another button resets wizard to step 1 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7969-fix-upload-model-UI-UX-improvements-for-Upload-Model-Dialog-2e66d73d3650815c8184cedb3d02672d) by [Unito](https://www.unito.io)
152 lines
4.2 KiB
Vue
152 lines
4.2 KiB
Vue
<template>
|
|
<div class="flex justify-end gap-2 w-full">
|
|
<div
|
|
v-if="currentStep === 1 && flags.huggingfaceModelImportEnabled"
|
|
class="mr-auto flex items-center gap-2"
|
|
>
|
|
<i class="icon-[lucide--circle-question-mark] text-muted-foreground" />
|
|
<Button
|
|
variant="muted-textonly"
|
|
size="sm"
|
|
data-attr="upload-model-step1-help-civitai"
|
|
@click="showCivitaiHelp = true"
|
|
>
|
|
{{ $t('assetBrowser.providerCivitai') }}
|
|
</Button>
|
|
<Button
|
|
variant="muted-textonly"
|
|
size="sm"
|
|
data-attr="upload-model-step1-help-huggingface"
|
|
@click="showHuggingFaceHelp = true"
|
|
>
|
|
{{ $t('assetBrowser.providerHuggingFace') }}
|
|
</Button>
|
|
</div>
|
|
<Button
|
|
v-else-if="currentStep === 1"
|
|
variant="muted-textonly"
|
|
size="lg"
|
|
class="mr-auto underline"
|
|
data-attr="upload-model-step1-help-link"
|
|
@click="showCivitaiHelp = true"
|
|
>
|
|
<i class="icon-[lucide--circle-question-mark]" />
|
|
<span>{{ $t('assetBrowser.uploadModelHowDoIFindThis') }}</span>
|
|
</Button>
|
|
<Button
|
|
v-if="currentStep === 1"
|
|
variant="muted-textonly"
|
|
size="lg"
|
|
data-attr="upload-model-step1-cancel-button"
|
|
:disabled="isFetchingMetadata || isUploading"
|
|
@click="emit('close')"
|
|
>
|
|
{{ $t('g.cancel') }}
|
|
</Button>
|
|
<Button
|
|
v-if="currentStep !== 1 && currentStep !== 3"
|
|
variant="muted-textonly"
|
|
size="lg"
|
|
:data-attr="`upload-model-step${currentStep}-back-button`"
|
|
:disabled="isFetchingMetadata || isUploading"
|
|
@click="emit('back')"
|
|
>
|
|
{{ $t('g.back') }}
|
|
</Button>
|
|
<span v-else />
|
|
|
|
<Button
|
|
v-if="currentStep === 1"
|
|
variant="secondary"
|
|
size="lg"
|
|
data-attr="upload-model-step1-continue-button"
|
|
:disabled="!canFetchMetadata || isFetchingMetadata"
|
|
@click="emit('fetchMetadata')"
|
|
>
|
|
<i
|
|
v-if="isFetchingMetadata"
|
|
class="icon-[lucide--loader-circle] animate-spin"
|
|
/>
|
|
<span>{{ $t('g.continue') }}</span>
|
|
</Button>
|
|
<Button
|
|
v-else-if="currentStep === 2"
|
|
variant="secondary"
|
|
size="lg"
|
|
data-attr="upload-model-step2-confirm-button"
|
|
:disabled="!canUploadModel || isUploading"
|
|
@click="emit('upload')"
|
|
>
|
|
<i v-if="isUploading" class="icon-[lucide--loader-circle] animate-spin" />
|
|
<span>{{ $t('assetBrowser.upload') }}</span>
|
|
</Button>
|
|
<template
|
|
v-else-if="
|
|
currentStep === 3 &&
|
|
(uploadStatus === 'success' || uploadStatus === 'processing')
|
|
"
|
|
>
|
|
<Button
|
|
variant="muted-textonly"
|
|
size="lg"
|
|
data-attr="upload-model-step3-import-another-button"
|
|
@click="emit('importAnother')"
|
|
>
|
|
{{ $t('assetBrowser.importAnother') }}
|
|
</Button>
|
|
<Button
|
|
variant="secondary"
|
|
size="lg"
|
|
data-attr="upload-model-step3-finish-button"
|
|
@click="emit('close')"
|
|
>
|
|
{{
|
|
uploadStatus === 'processing'
|
|
? $t('g.close')
|
|
: $t('assetBrowser.finish')
|
|
}}
|
|
</Button>
|
|
</template>
|
|
<VideoHelpDialog
|
|
v-model="showCivitaiHelp"
|
|
video-url="https://media.comfy.org/compressed_768/civitai_howto.webm"
|
|
:aria-label="$t('assetBrowser.uploadModelHelpVideo')"
|
|
/>
|
|
<VideoHelpDialog
|
|
v-model="showHuggingFaceHelp"
|
|
video-url="https://media.comfy.org/byom/huggingfacehowto.mp4"
|
|
:aria-label="$t('assetBrowser.uploadModelHelpVideo')"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref } from 'vue'
|
|
|
|
import Button from '@/components/ui/button/Button.vue'
|
|
import { useFeatureFlags } from '@/composables/useFeatureFlags'
|
|
import VideoHelpDialog from '@/platform/assets/components/VideoHelpDialog.vue'
|
|
|
|
const { flags } = useFeatureFlags()
|
|
|
|
const showCivitaiHelp = ref(false)
|
|
const showHuggingFaceHelp = ref(false)
|
|
|
|
defineProps<{
|
|
currentStep: number
|
|
isFetchingMetadata: boolean
|
|
isUploading: boolean
|
|
canFetchMetadata: boolean
|
|
canUploadModel: boolean
|
|
uploadStatus?: 'processing' | 'success' | 'error'
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'back'): void
|
|
(e: 'fetchMetadata'): void
|
|
(e: 'upload'): void
|
|
(e: 'close'): void
|
|
(e: 'importAnother'): void
|
|
}>()
|
|
</script>
|