The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
feat(create): model picker beside Generate + T2V/I2V switch + Advanced Settings disclosure
purplec1263baccb56
diff --git a/src/components/create/CreateView.tsx b/src/components/create/CreateView.tsxindex bd057bb2..7bdf28cd 100644--- a/src/components/create/CreateView.tsx+++ b/src/components/create/CreateView.tsx@@ -1,7 +1,7 @@import { useEffect, useState, useCallback, useRef } from 'react'-import { Image, Video, WifiOff, Loader2, AlertTriangle, RefreshCw, Settings, FolderOpen, HardDriveDownload, CheckCircle2, XCircle, Download, Pause, Play, X as XIcon, Upload, ImagePlus, PackageOpen, FileVideo } from 'lucide-react'+import { Image, Video, WifiOff, Loader2, AlertTriangle, RefreshCw, ChevronDown, FolderOpen, HardDriveDownload, CheckCircle2, XCircle, Download, Pause, Play, X as XIcon, Upload, ImagePlus, PackageOpen, FileVideo } from 'lucide-react'import { backendCall } from '../../api/backend'-import { freeMemory, uploadImage, classifyModel } from '../../api/comfyui'+import { freeMemory, uploadImage, isI2VModel } from '../../api/comfyui'import { startModelDownload, getDownloadProgress, pauseDownload, cancelDownload, resumeDownload } from '../../api/discover'import { useCreate } from '../../hooks/useCreate'import { useCreateStore } from '../../stores/createStore'@@ -184,7 +184,7 @@ export function CreateView() {connected, imageModels, videoModels, samplerList, schedulerList,videoBackend, modelsLoaded, modelLoadError, checkConnection, fetchModels, runPreflight, generate, cancel,} = useCreate()- const { mode, setMode, imageSubMode, error, preflightReady, preflightErrors, preflightWarnings, videoModel, i2vImage, setI2vImage, i2iImage, setI2iImage, denoise, setDenoise } = useCreateStore()+ const { mode, setMode, imageSubMode, videoSubMode, error, preflightReady, preflightErrors, preflightWarnings, videoModel, setVideoModel, i2vImage, setI2vImage, i2iImage, setI2iImage, denoise, setDenoise } = useCreateStore()const [status, setStatus] = useState<ComfyStatus | null>(null)const [startupLogs, setStartupLogs] = useState<string[]>([])@@ -334,9 +334,23 @@ export function CreateView() {}}, [mode, videoModel, connected, modelsLoaded, runPreflight])- // Detect I2V model (SVD, FramePack need an input image)- const videoModelType = videoModel ? classifyModel(videoModel) : null- const isI2V = mode === 'video' && (videoModelType === 'svd' || videoModelType === 'framepack')+ // Image-to-Video is now an explicit sub-mode (set from the main screen),+ // mirroring the image T2I/I2I switch. When the user is in I2V we show the+ // input-image dropzone below.+ const isI2V = mode === 'video' && videoSubMode === 'i2v'++ // Keep the selected video model valid for the chosen T2V/I2V sub-mode. Runs+ // on sub-mode toggle AND when the model list finishes loading, so the+ // main-screen switch works without the Advanced panel being mounted.+ useEffect(() => {+ if (mode !== 'video' || videoModels.length === 0) return+ const wantI2V = videoSubMode === 'i2v'+ const filtered = videoModels.filter((m) => (wantI2V ? isI2VModel(m.name) : !isI2VModel(m.name)))+ if (filtered.length === 0) return+ if (!filtered.some((m) => m.name === videoModel)) {+ setVideoModel(filtered[0].name)+ }+ }, [mode, videoSubMode, videoModels, videoModel, setVideoModel])const handleI2vUpload = async (file: File) => {if (!file.type.startsWith('image/')) return@@ -693,12 +707,13 @@ export function CreateView() {)}<buttononClick={() => setShowParams(!showParams)}- title={showParams ? 'Hide advanced parameters' : 'Show advanced parameters'}- aria-pressed={showParams}- aria-label="Toggle advanced parameters"- className={`p-1.5 rounded-lg transition-colors ${showParams ? 'bg-gray-200 dark:bg-white/10 text-gray-800 dark:text-gray-200' : 'hover:bg-gray-100 dark:hover:bg-white/10 text-gray-500'}`}+ title={showParams ? 'Hide advanced settings' : 'Show advanced settings'}+ aria-expanded={showParams}+ aria-label="Toggle advanced settings"+ className={`flex items-center gap-1 px-2 py-1 rounded-lg text-xs font-medium transition-colors ${showParams ? 'bg-gray-200 dark:bg-white/10 text-gray-800 dark:text-gray-200' : 'hover:bg-gray-100 dark:hover:bg-white/10 text-gray-500'}`}>- <Settings size={14} />+ Advanced Settings+ <ChevronDown size={14} className={`transition-transform ${showParams ? 'rotate-180' : ''}`} /></button></div></div>@@ -832,7 +847,7 @@ export function CreateView() {{i2vUploading ? 'Uploading...' : 'Drop or click to upload input image'}</span><span className="text-[9px] text-gray-600">- {videoModelType === 'svd' ? 'SVD' : 'FramePack'} generates video from an image+ Image-to-Video: animates your input image guided by the prompt</span></button>)}@@ -949,7 +964,7 @@ export function CreateView() {{/* Prompt */}{!showNoModelsEmptyState && (- <PromptInput onGenerate={generate} onCancel={cancel} disabled={!connected || !modelsLoaded} />+ <PromptInput onGenerate={generate} onCancel={cancel} disabled={!connected || !modelsLoaded} imageModels={imageModels} videoModels={videoModels} />)}</div>@@ -980,7 +995,7 @@ export function CreateView() {<div className="flex items-center justify-between mb-3"><p className="text-[10px] font-medium text-gray-600 uppercase tracking-widest">Parameters</p><button onClick={() => setShowParams(false)} className="p-1 text-gray-500 hover:text-gray-300" aria-label="Close settings panel">- <Settings size={12} />+ <XIcon size={12} /></button></div><ParamPaneldiff --git a/src/components/create/ParamPanel.tsx b/src/components/create/ParamPanel.tsxindex 63b3ac35..6b1a0e0d 100644--- a/src/components/create/ParamPanel.tsx+++ b/src/components/create/ParamPanel.tsx@@ -65,25 +65,18 @@ export function ParamPanel({ imageModels, videoModels, samplerList, schedulerLisconst store = useCreateStore()const isVideo = store.mode === 'video'const isI2I = store.mode === 'image' && store.imageSubMode === 'img2img'- const [videoSubTab, setVideoSubTab] = useState<'t2v' | 'i2v'>('t2v')+ // Sub-mode now lives in the store (shared with the main-screen T2V/I2V+ // switch). CreateView owns the always-mounted effect that re-points+ // store.videoModel to a valid entry when the sub-mode changes.+ const videoSubMode = store.videoSubModeconst sizePresets = isVideo ? VID_SIZE_PRESETS : getImageSizePresets(store.imageModelType)- // Filter video models by sub-tab+ // Filter video models by sub-modeconst filteredVideoModels = isVideo- ? videoModels.filter(m => videoSubTab === 'i2v' ? isI2VModel(m.name) : !isI2VModel(m.name))+ ? videoModels.filter(m => videoSubMode === 'i2v' ? isI2VModel(m.name) : !isI2VModel(m.name)): videoModelsconst models = isVideo ? filteredVideoModels : imageModels // i2i also uses imageModels- // Auto-select first model in filtered list when switching video sub-tabs- useEffect(() => {- if (!isVideo || filteredVideoModels.length === 0) return- const currentModel = store.videoModel- const isCurrentInList = filteredVideoModels.some(m => m.name === currentModel)- if (!isCurrentInList) {- store.setVideoModel(filteredVideoModels[0].name)- }- }, [videoSubTab, isVideo])-const sel = 'w-full px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-[#1a1a1a] border border-gray-200 dark:border-white/8 text-gray-900 dark:text-white text-[11px] focus:outline-none focus:border-gray-400 dark:focus:border-white/20 cursor-pointer'const lbl = 'text-[10px] font-medium text-gray-500 dark:text-gray-600 uppercase tracking-widest mb-1 block'@@ -104,9 +97,9 @@ export function ParamPanel({ imageModels, videoModels, samplerList, schedulerLis{isVideo && (<div className="flex rounded-lg bg-gray-100 dark:bg-white/5 p-0.5 gap-0.5"><button- onClick={() => setVideoSubTab('t2v')}+ onClick={() => store.setVideoSubMode('t2v')}className={`flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-md text-[10px] font-medium transition-all ${- videoSubTab === 't2v'+ videoSubMode === 't2v'? 'bg-white dark:bg-white/15 text-gray-900 dark:text-white shadow-sm': 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'}`}@@ -115,9 +108,9 @@ export function ParamPanel({ imageModels, videoModels, samplerList, schedulerLisText to Video</button><button- onClick={() => setVideoSubTab('i2v')}+ onClick={() => store.setVideoSubMode('i2v')}className={`flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-md text-[10px] font-medium transition-all ${- videoSubTab === 'i2v'+ videoSubMode === 'i2v'? 'bg-white dark:bg-white/15 text-gray-900 dark:text-white shadow-sm': 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'}`}@@ -158,7 +151,7 @@ export function ParamPanel({ imageModels, videoModels, samplerList, schedulerLis{/* Model */}<div>- <label className={lbl}>{isVideo ? (videoSubTab === 'i2v' ? 'I2V Model' : 'Video Model') : 'Image Model'}</label>+ <label className={lbl}>{isVideo ? (videoSubMode === 'i2v' ? 'I2V Model' : 'Video Model') : 'Image Model'}</label>{modelLoadError ? (<div className="space-y-1"><div className="px-2.5 py-1.5 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-[10px]">diff --git a/src/components/create/PromptInput.tsx b/src/components/create/PromptInput.tsxindex d3e5644c..be145ba2 100644--- a/src/components/create/PromptInput.tsx+++ b/src/components/create/PromptInput.tsx@@ -2,15 +2,34 @@ import { useState, useRef } from 'react'import { motion, AnimatePresence } from 'framer-motion'import { Sparkles, Square, ChevronDown, ChevronUp, History, X } from 'lucide-react'import { useCreateStore } from '../../stores/createStore'+import { classifyModel, isI2VModel } from '../../api/comfyui'+import type { ClassifiedModel } from '../../api/comfyui'interface Props {onGenerate: () => voidonCancel: () => voiddisabled?: boolean+ imageModels: ClassifiedModel[]+ videoModels: ClassifiedModel[]}-export function PromptInput({ onGenerate, onCancel, disabled }: Props) {- const { prompt, negativePrompt, isGenerating, promptHistory, mode, imageSubMode, setPrompt, setNegativePrompt, setImageSubMode } = useCreateStore()+export function PromptInput({ onGenerate, onCancel, disabled, imageModels, videoModels }: Props) {+ const {+ prompt, negativePrompt, isGenerating, promptHistory, mode, imageSubMode, videoSubMode,+ imageModel, videoModel, setPrompt, setNegativePrompt, setImageSubMode, setVideoSubMode,+ setImageModel, setVideoModel,+ } = useCreateStore()++ // Model picker (lives right next to Generate). Video models are filtered by+ // the T2V/I2V sub-mode so the list only shows compatible checkpoints.+ const modelOptions = mode === 'video'+ ? videoModels.filter((m) => (videoSubMode === 'i2v' ? isI2VModel(m.name) : !isI2VModel(m.name)))+ : imageModels+ const activeModelValue = mode === 'video' ? videoModel : imageModel+ const onModelChange = (name: string) => {+ if (mode === 'video') setVideoModel(name)+ else setImageModel(name, classifyModel(name))+ }const [showNegative, setShowNegative] = useState(false)const [showHistory, setShowHistory] = useState(false)const textareaRef = useRef<HTMLTextAreaElement>(null)@@ -106,6 +125,24 @@ export function PromptInput({ onGenerate, onCancel, disabled }: Props) {>I2I</button></div>)}+ {/* Text-to-Video / Image-to-Video — mirrors the image T2I/I2I switch+ so the video mode is fully selectable from the main screen+ (drives `videoSubMode`, which filters the model list + gates the+ I2V image upload in CreateView). */}+ {mode === 'video' && (+ <div className="flex items-center rounded-md border border-gray-200 dark:border-white/10 overflow-hidden text-[0.6rem]">+ <button+ onClick={() => setVideoSubMode('t2v')}+ className={`px-1.5 py-0.5 font-medium transition-colors ${videoSubMode === 't2v' ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white' : 'text-gray-500 hover:text-gray-800 dark:hover:text-gray-200'}`}+ title="Text to Video"+ >T2V</button>+ <button+ onClick={() => setVideoSubMode('i2v')}+ className={`px-1.5 py-0.5 font-medium transition-colors ${videoSubMode === 'i2v' ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white' : 'text-gray-500 hover:text-gray-800 dark:hover:text-gray-200'}`}+ title="Image to Video"+ >I2V</button>+ </div>+ )}</div><div className="flex items-center gap-2">{prompt.trim() && !isGenerating && (@@ -113,6 +150,23 @@ export function PromptInput({ onGenerate, onCancel, disabled }: Props) {<X size={14} /></button>)}+ {/* Model picker — sits directly left of Generate so the active+ image / video model is always visible + switchable without+ opening Advanced. Hidden until models are discovered. */}+ {modelOptions.length > 0 && (+ <select+ value={activeModelValue}+ onChange={(e) => onModelChange(e.target.value)}+ disabled={isGenerating || disabled}+ title={activeModelValue || `Select ${mode} model`}+ aria-label={`${mode} model`}+ className="max-w-[160px] px-2 py-1.5 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-gray-700 dark:text-gray-200 text-xs focus:outline-none focus:border-gray-400 dark:focus:border-white/20 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed"+ >+ {modelOptions.map((m) => (+ <option key={m.name} value={m.name}>{m.name.replace(/\.[^.]+$/, '')}</option>+ ))}+ </select>+ )}{isGenerating ? (<motion.buttononClick={onCancel}diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.tsindex 59adc55b..ac8c1d3c 100644--- a/src/hooks/useCreate.ts+++ b/src/hooks/useCreate.ts@@ -264,6 +264,10 @@ export function useCreate() {setError('Please upload a source image for Image-to-Image.')return}+ if (mode === 'video' && state.videoSubMode === 'i2v' && !i2vImage) {+ setError('Please upload an input image for Image-to-Video.')+ return+ }if (!activeModel) {setError(mode === 'image'? 'No image model selected. Add checkpoints or FLUX models to ComfyUI.'diff --git a/src/stores/createStore.ts b/src/stores/createStore.tsindex 8a568066..63c59b24 100644--- a/src/stores/createStore.ts+++ b/src/stores/createStore.ts@@ -50,6 +50,10 @@ export interface GalleryItem {interface CreateState {mode: 'image' | 'video'imageSubMode: 'text2img' | 'img2img'+ // Video sub-mode mirrors imageSubMode so the main Create screen can offer a+ // Text-to-Video / Image-to-Video switch (the I2V upload + model filter key+ // off this). Session-only (not persisted), defaults to 't2v' each launch.+ videoSubMode: 't2v' | 'i2v'prompt: stringnegativePrompt: stringimageModel: string@@ -104,6 +108,7 @@ interface CreateState {setPreflightStatus: (ready: boolean | null, errors: PreflightError[], warnings: string[]) => voidsetMode: (mode: 'image' | 'video') => voidsetImageSubMode: (subMode: 'text2img' | 'img2img') => void+ setVideoSubMode: (subMode: 't2v' | 'i2v') => voidsetPrompt: (prompt: string) => voidsetNegativePrompt: (negativePrompt: string) => voidsetImageModel: (model: string, type: ModelType) => void@@ -145,6 +150,7 @@ export const useCreateStore = create<CreateState>()((set) => ({mode: 'image',imageSubMode: 'text2img' as 'text2img' | 'img2img',+ videoSubMode: 't2v' as 't2v' | 'i2v',prompt: '',negativePrompt: '',imageModel: '',@@ -212,6 +218,10 @@ export const useCreateStore = create<CreateState>()(return { mode }}),setImageSubMode: (subMode) => set({ imageSubMode: subMode }),+ // Plain setter — CreateView owns an always-mounted effect that re-points+ // videoModel to a valid entry for the chosen sub-mode (so toggling works+ // whether or not the Advanced panel is open).+ setVideoSubMode: (subMode: 't2v' | 'i2v') => set({ videoSubMode: subMode }),setPrompt: (prompt) => set({ prompt }),setNegativePrompt: (negativePrompt) => set({ negativePrompt }),setImageModel: (model, type) => {