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
fix(create): das CPU-Band nennt den Grund, den es wirklich gab
purple43d053a8a79c
diff --git a/src/components/create/experimental/CreateContext.tsx b/src/components/create/experimental/CreateContext.tsxindex 737ab659..5449818c 100644--- a/src/components/create/experimental/CreateContext.tsx+++ b/src/components/create/experimental/CreateContext.tsx@@ -6,7 +6,8 @@ import { useCreateStore, type GalleryItem } from '../../../stores/createStore'import { getLoraModels, getVAEModels, checkComfyConnection, refreshComfyModels, bundleForVideoIntent } from '../../../api/comfyui'import { getAllNodeInfo, clearNodeCache } from '../../../api/comfyui-nodes'import { installCustomNodes, getImageBundles, getVideoBundles, getAudioBundles, getLipsyncBundles, getMotionBundles, startModelDownload, getDownloadProgress, modelsNotVisibleInComfy, ENUM_SUBFOLDERS } from '../../../api/discover'-import { backendCall, isMacOS } from '../../../api/backend'+import { backendCall, isMacOS, isLinux } from '../../../api/backend'+import { asComfyGpuMode, comfyCpuBannerText, type ComfyCpuBannerFacts } from '../../../lib/comfy-cpu-banner'import { installMlxStack } from '../../../api/mlx-install'import { useDownloadStore } from '../../../stores/downloadStore'import { downloadBundleFiles, waitOrAbort, waitForModelsVisible } from '../../../lib/bundle-install'@@ -76,6 +77,11 @@ interface CreateExpValue {* RX 7900 XTX): surfaces the honest slow-mode warning instead of a silent* 20-minute timeout. */comfyOnCpu: boolean+ /** The finished banner sentence for that state, '' when there is none. It+ * differs by WHY the processor is in play (Force CPU vs nothing usable+ * found) and only mentions AMD on a machine that has an AMD card, see+ * lib/comfy-cpu-banner.ts. */+ comfyCpuBanner: string/** Install a missing capability in place: ensure ComfyUI runs (installing it* first if needed), download the custom node when one is required, restart,* and re-probe until available. Reports progress via the optional callback@@ -116,7 +122,9 @@ export function CreateExpProvider({ children }: { children: ReactNode }) {const setCaps = useCreateStore((s) => s.setCaps)const [loraList, setLoraList] = useState<string[]>([])const [vaeList, setVaeList] = useState<string[]>(['auto'])- const [comfyOnCpu, setComfyOnCpu] = useState(false)+ const [comfyCpu, setComfyCpu] = useState<ComfyCpuBannerFacts | null>(null)+ const comfyOnCpu = comfyCpu?.startedCpu === true+ const comfyCpuBanner = comfyCpuBannerText(comfyCpu)// Never strand the session on a dead axis: losing the license/logging out// while 'cloud' is selected falls back to local rendering.@@ -155,16 +163,29 @@ export function CreateExpProvider({ children }: { children: ReactNode }) {fetchModels()}, [checkConnection, fetchModels])- // Surface a CPU-only ComfyUI (no usable GPU detected) so an AMD / non-NVIDIA- // user isn't left staring at a silent 20-minute timeout. The Rust side records- // the launch mode at every ComfyUI (re)start; re-read it whenever the- // connection (re)establishes. Desktop-only (web has no such command → false).+ // Surface a CPU-only ComfyUI so a user isn't left staring at a silent+ // 20-minute timeout. The Rust side records the launch mode at every ComfyUI+ // (re)start; re-read it whenever the connection (re)establishes. Desktop-only+ // (web has no such command → no banner).+ //+ // `mode` and `hasAmd` come along since the R12/R13 re-measure: the banner used+ // to tell a user with a working RTX 3060 that no usable GPU had been detected,+ // when he had picked Force CPU himself, and then handed him AMD instructions+ // on a machine with no AMD card. All three facts were already in this reply.useEffect(() => {- if (connected !== true) { setComfyOnCpu(false); return }+ if (connected !== true) { setComfyCpu(null); return }let cancelled = false- backendCall<{ startedCpu?: boolean | null }>('get_comfy_gpu_status')- .then((s) => { if (!cancelled) setComfyOnCpu(s?.startedCpu === true) })- .catch(() => { if (!cancelled) setComfyOnCpu(false) })+ backendCall<{ startedCpu?: boolean | null; mode?: string | null; hasAmd?: boolean | null }>('get_comfy_gpu_status')+ .then((s) => {+ if (cancelled) return+ setComfyCpu({+ startedCpu: s?.startedCpu === true,+ mode: asComfyGpuMode(s?.mode),+ hasAmd: s?.hasAmd === true,+ isLinux: isLinux(),+ })+ })+ .catch(() => { if (!cancelled) setComfyCpu(null) })return () => { cancelled = true }}, [connected])@@ -497,7 +518,7 @@ export function CreateExpProvider({ children }: { children: ReactNode }) {enhanceVideo: cloud.enhanceVideo,makeVoice: cloud.makeVoice,samplerList, schedulerList, loraList, vaeList, refreshModelLists,- connected, modelsLoaded, modelLoadError, mlxMissing, comfyOnCpu, installCapability, installModelBundle,+ connected, modelsLoaded, modelLoadError, mlxMissing, comfyOnCpu, comfyCpuBanner, installCapability, installModelBundle,cloudAvailable, quota, refreshQuota,}return <Ctx.Provider value={value}>{children}</Ctx.Provider>diff --git a/src/components/create/experimental/CreateExperimental.tsx b/src/components/create/experimental/CreateExperimental.tsxindex c96bae24..b0f16c57 100644--- a/src/components/create/experimental/CreateExperimental.tsx+++ b/src/components/create/experimental/CreateExperimental.tsx@@ -16,7 +16,6 @@ import { MaskEditor } from './MaskEditor'import { VhsInstallModal } from './VhsInstallModal'import { INTENT_MAP, isIntentAvailable } from './intents'import { isMlxImageHost } from '../../../api/mlx-image'-import { isLinux } from '../../../api/backend'import { fetchGalleryItemBlob } from './galleryUrl'import { loadImageRef } from './loadImage'@@ -40,7 +39,7 @@ function CreateExperimentalInner() {const retentionNoticeSeen = useCloudNoticeStore((s) => s.retentionNoticeSeen)const setRetentionNoticeSeen = useCloudNoticeStore((s) => s.setRetentionNoticeSeen)const setManagerNoticeSeen = useWorkflowStore((s) => s.setManagerNoticeSeen)- const { modelLoadError, connected, comfyOnCpu } = useCreateExp()+ const { modelLoadError, connected, comfyOnCpu, comfyCpuBanner } = useCreateExp()const [shownId, setShownId] = useState<string | null>(null)const [advancedOpen, setAdvancedOpen] = useState(false)@@ -155,30 +154,21 @@ function CreateExperimentalInner() {)}</AnimatePresence>- {/* CPU-mode warning — persistent while LU's ComfyUI runs with --cpu.- Without it an AMD/non-NVIDIA user sees "Ready to generate" and then- a bare 20-minute timeout (shd_scorpion, RX 7900 XTX). Local renders- only — cloud jobs never touch the local ComfyUI. */}- {backend === 'local' && connected === true && comfyOnCpu && (+ {/* CPU-mode warning, persistent while LU's ComfyUI runs with --cpu.+ Without it a user sees "Ready to generate" and then a bare 20-minute+ timeout (shd_scorpion, RX 7900 XTX). Local renders only, cloud jobs+ never touch the local ComfyUI.++ The sentence itself lives in lib/comfy-cpu-banner.ts, because it is+ three sentences: the R12/R13 re-measure caught this bar telling a user+ with a working, correctly detected RTX 3060 that no usable GPU had+ been found, when he had chosen Force CPU himself, and then walking him+ through the AMD route on a machine with no AMD card in it. Same three+ facts the backend was already sending, now all three read. */}+ {backend === 'local' && connected === true && comfyOnCpu && comfyCpuBanner && (<div className="flex items-center gap-2 px-4 py-2 bg-yellow-500/5 border-b border-yellow-500/10 text-yellow-300 text-xs shrink-0"><AlertTriangle size={12} className="shrink-0" />- <span>- ComfyUI is running on the CPU (no usable GPU detected). Generation will be extremely slow and may time out.- {/* The right AMD path differs per OS — three users followed the- generic ZLUDA pointer on Linux, where ZLUDA guides are- Windows-only dead ends (numbrain/lapbo/suraj3014, 2026-08-02).- Linux AMD wants a ROCm torch inside ComfyUI's own venv.- Since 2.6.7 the ComfyUI installer picks the ROCm wheels itself- on an AMD Linux box, so the fix is a reinstall and not a pip- line the user has to type by hand. The Windows half said there- was no Windows ROCm wheel at all and pointed at DirectML, which- the round 12 research disproved: AMD publishes its own Windows- wheels, LU installs them for the cards AMD supports, and- DirectML has been frozen on an old PyTorch since 2024. */}- {isLinux()- ? ' AMD GPU? LU installs the ROCm build of PyTorch for AMD cards now. Reinstall the ComfyUI environment from Settings → ComfyUI, then set Settings → Hardware → ComfyUI GPU to Auto.'- : " AMD GPU? LU installs AMD's own ROCm build of PyTorch for RX 7000 and RX 9000 cards on Windows. Reinstall the ComfyUI environment from Settings → ComfyUI to try that again. For any other AMD card you need a ZLUDA ComfyUI of your own: point LU at it and set Settings → Hardware → ComfyUI GPU to force GPU."}- </span>+ <span>{comfyCpuBanner}</span></div>)}diff --git a/src/components/settings/__tests__/amd-copy-is-current.test.ts b/src/components/settings/__tests__/amd-copy-is-current.test.tsindex 7814e61c..8232085a 100644--- a/src/components/settings/__tests__/amd-copy-is-current.test.ts+++ b/src/components/settings/__tests__/amd-copy-is-current.test.ts@@ -36,7 +36,11 @@ const repo = resolve(here, '../../../..')const read = (rel: string) => readFileSync(resolve(repo, rel), 'utf8')const hardware = read('src/components/settings/HardwareSettings.tsx')-const createTab = read('src/components/create/experimental/CreateExperimental.tsx')+// Round 14 moved the Create tab's CPU banner copy out of the .tsx and into a+// pure module, because the banner became three sentences instead of one and the+// node-environment runner cannot render the component. Same copy, same pins,+// one file further along.+const createTab = read('src/lib/comfy-cpu-banner.ts')const wheels = read('src-tauri/src/commands/torch_wheels.rs')describe('THE FIX: the AMD copy says what the app does', () => {@@ -96,6 +100,6 @@ describe('NEGATIVE CONTROL: the sentences that were already true', () => {return text.slice(i, j)}expect(from(hardware, 'Written before 2.6.7', 'Takes effect on next ComfyUI start')).not.toMatch(/[–—]/)- expect(from(createTab, 'The Windows half said', 'to force GPU."}')).not.toMatch(/[–—]/)+ expect(from(createTab, 'The AMD half of the banner', 'to force GPU."')).not.toMatch(/[–—]/)})})diff --git a/src/lib/__tests__/cpu-banner-names-the-real-reason.test.ts b/src/lib/__tests__/cpu-banner-names-the-real-reason.test.tsnew file mode 100644index 00000000..bc59bc5d--- /dev/null+++ b/src/lib/__tests__/cpu-banner-names-the-real-reason.test.ts@@ -0,0 +1,141 @@+/**+ * Nebenbefund 1 of the R12/R13 re-measure on the real 2.6.7 Windows build+ * (2026-08-30, ergebnis-r1213-nachmessung.md, box: NVIDIA GeForce RTX 3060):+ *+ * "Der Klammerzusatz (no usable GPU detected) stimmt in genau diesem Fall+ * nicht. Auf dieser Maschine steckt eine funktionierende RTX 3060, die App+ * hat sie im selben Einstellungsdialog korrekt erkannt, und der CPU-Modus+ * kam allein durch die bewusste Wahl Force CPU zustande. Das Band+ * unterstellt dem Nutzer einen Erkennungsfehler, den es nicht gab, und+ * schickt ihn danach durch drei Saetze AMD-Hilfe, die ihn nichts angehen."+ *+ * Two wrong claims in one bar, and both were avoidable: `get_comfy_gpu_status`+ * has returned `mode` and `hasAmd` next to `startedCpu` all along, and the+ * Create tab read only the third. So the banner now has the three sentences the+ * three states deserve, and the AMD paragraph appears only where there is an+ * AMD card.+ *+ * Run: npx vitest run src/lib/__tests__/cpu-banner-names-the-real-reason.test.ts+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { dirname, resolve } from 'node:path'++import { comfyCpuBannerText, asComfyGpuMode, type ComfyCpuBannerFacts } from '../comfy-cpu-banner'++const here = dirname(fileURLToPath(import.meta.url))+const repo = resolve(here, '../../..')+const read = (rel: string) => readFileSync(resolve(repo, rel), 'utf8')++/** The box the re-measure ran on: one working NVIDIA card, no AMD, Windows. */+const NVIDIA_WINDOWS = { startedCpu: true, mode: 'auto', hasAmd: false, isLinux: false } as ComfyCpuBannerFacts++describe('THE FIX: the CPU banner names the reason that is actually true', () => {+ it('a user who picked Force CPU is told he picked it, not that his card is missing', () => {+ // The measured press: Settings, Hardware, ComfyUI GPU, Force CPU, on a box+ // whose RTX 3060 the same panel lists correctly two rows above.+ const text = comfyCpuBannerText({ ...NVIDIA_WINDOWS, mode: 'cpu' })+ expect(text).toMatch(/running on the CPU because you selected Force CPU/)+ // the claim the box disproved+ expect(text).not.toMatch(/no usable GPU detected/)+ })++ it('and it says where to put the switch back, which is the only thing that helps him', () => {+ const text = comfyCpuBannerText({ ...NVIDIA_WINDOWS, mode: 'cpu' })+ expect(text).toMatch(/Settings → Hardware → ComfyUI GPU back to Auto/)+ expect(text).toMatch(/restart ComfyUI from Settings → AI Backends/)+ })++ it('no AMD advice reaches a machine with no AMD card, in either mode', () => {+ for (const mode of ['auto', 'cpu', 'gpu'] as const) {+ const text = comfyCpuBannerText({ ...NVIDIA_WINDOWS, mode })+ expect(text).not.toMatch(/AMD/)+ expect(text).not.toMatch(/ZLUDA/)+ expect(text).not.toMatch(/ROCm/)+ }+ })++ it('an AMD card still gets the AMD route, and the OS decides which one', () => {+ const win = comfyCpuBannerText({ ...NVIDIA_WINDOWS, hasAmd: true })+ expect(win).toMatch(/AMD's own ROCm build of PyTorch for RX 7000 and RX 9000 cards on Windows/)+ expect(win).toMatch(/you need a ZLUDA ComfyUI of your own/)++ const linux = comfyCpuBannerText({ ...NVIDIA_WINDOWS, hasAmd: true, isLinux: true })+ expect(linux).toMatch(/LU installs the ROCm build of PyTorch for AMD cards now/)+ // the Windows-only dead end three Linux users followed in round 12+ expect(linux).not.toMatch(/ZLUDA/)+ })++ it('the AMD paragraph is skipped even for an AMD owner who forced the CPU himself', () => {+ // He did not hit a driver problem, he flipped a switch. Handing him a+ // reinstall of the ComfyUI environment would send him after a fault that+ // does not exist.+ const text = comfyCpuBannerText({ startedCpu: true, mode: 'cpu', hasAmd: true, isLinux: false })+ expect(text).toMatch(/because you selected Force CPU/)+ expect(text).not.toMatch(/AMD/)+ })++ it('the Create tab renders this text instead of carrying a fourth copy of it', () => {+ const tab = read('src/components/create/experimental/CreateExperimental.tsx')+ expect(tab).toMatch(/comfyOnCpu && comfyCpuBanner &&/)+ expect(tab).toMatch(/<span>\{comfyCpuBanner\}<\/span>/)+ // the single hard-coded sentence that could not tell the states apart+ expect(tab).not.toMatch(/no usable GPU detected/)+ const ctx = read('src/components/create/experimental/CreateContext.tsx')+ // and all three facts are read off the reply that always carried them+ expect(ctx).toMatch(/startedCpu: s\?\.startedCpu === true/)+ expect(ctx).toMatch(/mode: asComfyGpuMode\(s\?\.mode\)/)+ expect(ctx).toMatch(/hasAmd: s\?\.hasAmd === true/)+ })++ it('the backend really sends all three, so the frontend is not inventing them', () => {+ const rust = read('src-tauri/src/commands/process.rs')+ expect(rust).toMatch(/"mode": mode, "startedCpu": started_cpu, "hasAmd": has_amd/)+ // "cpu" is the Force CPU entry, which is what mode === 'cpu' leans on+ expect(rust).toMatch(/"cpu" => ComfyGpuMode::ForceCpu/)+ })+})++describe('NEGATIVE CONTROL: what the banner did right stays untouched', () => {+ it('a plain fallback to the processor keeps the exact sentence it always had', () => {+ // Nothing about this case was wrong. shd_scorpion's RX 7900 XTX is still+ // the reason the bar exists at all.+ expect(comfyCpuBannerText(NVIDIA_WINDOWS)).toBe(+ 'ComfyUI is running on the CPU (no usable GPU detected). Generation will be extremely slow and may time out.',+ )+ })++ it('every variant still warns about the speed, which is the point of the bar', () => {+ const all = [+ comfyCpuBannerText(NVIDIA_WINDOWS),+ comfyCpuBannerText({ ...NVIDIA_WINDOWS, mode: 'cpu' }),+ comfyCpuBannerText({ ...NVIDIA_WINDOWS, hasAmd: true }),+ ]+ for (const t of all) expect(t).toMatch(/extremely slow and may time out/)+ })++ it('there is no bar at all when ComfyUI is not on the processor', () => {+ expect(comfyCpuBannerText({ ...NVIDIA_WINDOWS, startedCpu: false })).toBe('')+ // Force CPU chosen but ComfyUI not (re)started under it yet: nothing is+ // running on the CPU, so nothing may be claimed.+ expect(comfyCpuBannerText({ ...NVIDIA_WINDOWS, startedCpu: false, mode: 'cpu' })).toBe('')+ expect(comfyCpuBannerText(null)).toBe('')+ expect(comfyCpuBannerText(undefined)).toBe('')+ })++ it('an unknown or missing mode is read as auto, never as a forced CPU', () => {+ // A backend that answers with nothing, or with something new, must not be+ // able to tell a user he pressed a button he never pressed.+ expect(asComfyGpuMode(undefined)).toBe('auto')+ expect(asComfyGpuMode(null)).toBe('auto')+ expect(asComfyGpuMode('')).toBe('auto')+ expect(asComfyGpuMode('something-else')).toBe('auto')+ expect(asComfyGpuMode('CPU')).toBe('cpu')+ expect(asComfyGpuMode(' gpu ')).toBe('gpu')+ })++ it('no em dash anywhere in the new copy', () => {+ expect(read('src/lib/comfy-cpu-banner.ts')).not.toMatch(/[–—]/)+ })+})diff --git a/src/lib/comfy-cpu-banner.ts b/src/lib/comfy-cpu-banner.tsnew file mode 100644index 00000000..54156ec6--- /dev/null+++ b/src/lib/comfy-cpu-banner.ts@@ -0,0 +1,91 @@+/**+ * The sentence the Create tab shows while ComfyUI is rendering on the processor.+ *+ * Nebenbefund 1 of the R12/R13 re-measure on the real 2.6.7 Windows build+ * (2026-08-30, ergebnis-r1213-nachmessung.md):+ *+ * "Der Klammergrund im CPU-Band ist bei Force CPU falsch. (no usable GPU+ * detected) bei erkannter und funktionierender RTX 3060."+ *+ * The banner had exactly one text for two very different situations. On that+ * box the user had picked `Force CPU` himself in Settings, Hardware, ComfyUI+ * GPU, the app had listed his RTX 3060 correctly two panels away, and the+ * banner still told him no usable GPU had been found and then walked him+ * through three sentences of AMD advice on a machine with no AMD card in it.+ *+ * The state is distinguishable, so it gets distinguished. `get_comfy_gpu_status`+ * already returns all three facts (`mode`, `startedCpu`, `hasAmd`); only the+ * frontend was throwing two of them away.+ *+ * 1. `mode === 'cpu'` the user chose this. Say so, and say where to undo it.+ * 2. no AMD card the old sentence, which is true here: nothing usable+ * was found.+ * 3. an AMD card the same sentence plus the AMD route, which is the+ * one case where those three sentences help.+ *+ * Pure and stringly on purpose: the Create tab is a .tsx the node-environment+ * test runner does not render, so the copy lives where it can be asserted.+ */++/** The user's ComfyUI device override, as `get_comfy_gpu_status` reports it. */+export type ComfyGpuModeName = 'auto' | 'cpu' | 'gpu'++/** What LU knows about the ComfyUI it started this session. */+export interface ComfyCpuBannerFacts {+ /** LU itself started ComfyUI with `--cpu` this session. */+ startedCpu: boolean+ /** Settings, Hardware, ComfyUI GPU. `cpu` is the Force CPU entry. */+ mode: ComfyGpuModeName+ /** An AMD card is present on this machine (same probe the installers use). */+ hasAmd: boolean+ /** Host is Linux. The AMD answer differs per OS and always has. */+ isLinux: boolean+}++/** Normalise whatever the backend handed us into the three known modes. */+export function asComfyGpuMode(value: unknown): ComfyGpuModeName {+ const s = String(value ?? '').trim().toLowerCase()+ return s === 'cpu' || s === 'gpu' ? s : 'auto'+}++/**+ * The AMD half of the banner. Windows and Linux take different routes, which+ * is the finding three users hit in round 12 (numbrain/lapbo/suraj3014): the+ * generic ZLUDA pointer is a Windows-only dead end on Linux, and the Windows+ * half used to claim there was no Windows ROCm wheel at all, which AMD's own+ * index disproves.+ *+ * It is a separate export because it is now CONDITIONAL: a machine with no AMD+ * card never reads it. That was the second half of the R12/R13 finding.+ */+export function amdCpuAdvice(isLinux: boolean): string {+ return isLinux+ ? ' AMD GPU? LU installs the ROCm build of PyTorch for AMD cards now. Reinstall the ComfyUI environment from Settings → ComfyUI, then set Settings → Hardware → ComfyUI GPU to Auto.'+ : " AMD GPU? LU installs AMD's own ROCm build of PyTorch for RX 7000 and RX 9000 cards on Windows. Reinstall the ComfyUI environment from Settings → ComfyUI to try that again. For any other AMD card you need a ZLUDA ComfyUI of your own: point LU at it and set Settings → Hardware → ComfyUI GPU to force GPU."+}++/** The slowness warning both honest variants share, word for word. */+const SLOW = 'Generation will be extremely slow and may time out.'++/**+ * The whole banner text, or '' when there is no banner to draw.+ *+ * Empty string is the single "say nothing" answer, so a caller cannot render a+ * yellow bar with no reason in it.+ */+export function comfyCpuBannerText(facts: ComfyCpuBannerFacts | null | undefined): string {+ if (!facts?.startedCpu) return ''++ // 1. The user asked for this. Nothing was detected wrongly, nothing is+ // broken, and the AMD route is beside the point: the way out is the+ // switch he set himself, so that is the only thing worth naming.+ if (facts.mode === 'cpu') {+ return `ComfyUI is running on the CPU because you selected Force CPU. ${SLOW} Set Settings → Hardware → ComfyUI GPU back to Auto and restart ComfyUI from Settings → AI Backends to use your card again.`+ }++ // 2. and 3. LU fell back to the processor on its own, so the old sentence is+ // the true one. The AMD paragraph rides along only where there is an AMD+ // card to talk about.+ const head = `ComfyUI is running on the CPU (no usable GPU detected). ${SLOW}`+ return facts.hasAmd ? head + amdCpuAdvice(facts.isLinux) : head+}