The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
AI setup: the working folder on Windows, a Mac's memory and --cpu; pairing beside the web address
Adarsh0b81e531e468
diff --git a/src/components/gpu/connect-choice.tsx b/src/components/gpu/connect-choice.tsxindex b2d919e2..295f7487 100644--- a/src/components/gpu/connect-choice.tsx+++ b/src/components/gpu/connect-choice.tsx@@ -16,7 +16,8 @@ import type { OwnerGpuView } from "@/lib/connections";import { addressKind, refusedOnHosted } from "@/lib/page-place";import { cn } from "@/lib/utils";import { restartComputerRunner, rememberComfy, rememberedComfy } from "./computer-runtime";-import { PairedComfyUIs } from "./fuobe-connect";+import { FUOBE_CONNECT_PUBLISHED } from "@/lib/fuobe-connect";+import { PairInstead, PairedComfyUIs } from "./fuobe-connect";import { GuardFix, SettingFix, ThisComputer, unsupportedWords } from "./this-computer";import { lookOn, useComputerSupport, usePagePlace } from "./use-local-comfy";import { openConnect, openFinder, useComputerState, type FindReason } from "./computer-runner";@@ -509,7 +510,7 @@ function AccountChoice({ fromRun, kind, reason, onStart, onNotNow, className, loclassName={className}instead={linked}title="Keep it running with this tab closed"- sub="Give your ComfyUI a web address. Takes about two minutes."+ sub={FUOBE_CONNECT_PUBLISHED ? "Pair your ComfyUI with a code, or give it a web address. Takes about two minutes." : "Give your ComfyUI a web address. Takes about two minutes."}open={link || linked}onToggle={() => setLink((v) => !v)}computer={@@ -530,7 +531,10 @@ function AccountChoice({ fromRun, kind, reason, onStart, onNotNow, className, lo</div>}>- <YourGpu className={className} onLinked={onStart} />+ <div className="space-y-3">+ {FUOBE_CONNECT_PUBLISHED && <PairInstead />}+ <YourGpu className={className} onLinked={onStart} />+ </div></ChoiceCards></div>);diff --git a/src/lib/ai-setup/guide.ts b/src/lib/ai-setup/guide.tsindex 3079d02a..b4c43bba 100644--- a/src/lib/ai-setup/guide.ts+++ b/src/lib/ai-setup/guide.ts@@ -130,6 +130,15 @@ const curl = (os: Os) => (os === "windows" ? "curl.exe" : "curl");const TUNNEL = "cloudflared tunnel --url http://127.0.0.1:8188 --logfile ~/.fuobe/tunnel.log";const sep = (os: Os) => (os === "windows" ? "\\" : "/");+/** Step 1's line about --cpu (the status points there when ComfyUI was started with it). */+const CPU_FLAG: Record<"windows" | "mac" | "linux", string> = {+ windows:+ "If the command line has --cpu, ComfyUI runs on the processor only, never on the graphics card. The portable build's run_cpu.bat starts it with --cpu, and run_nvidia_gpu.bat starts it without. A start file made from that command line keeps --cpu, and so does Fuobe's Start ComfyUI for Fuobe.bat. To use the graphics card, start ComfyUI without --cpu: with run_nvidia_gpu.bat, or with the same command without --cpu. Ask the person first: it restarts ComfyUI.",+ mac: "If the command has --cpu, ComfyUI runs on the processor only, never on the GPU. To use the GPU, start ComfyUI the same way without --cpu (Stability Matrix: remove it in Launch Options). Ask the person first: it restarts ComfyUI.",+ linux:+ "If the command has --cpu, ComfyUI runs on the processor only, never on the graphics card. To use the graphics card, start ComfyUI the same way without --cpu (Stability Matrix: remove it in Launch Options; a service or Docker: remove it from its start command). Ask the person first: it restarts ComfyUI.",+};+function stepZero(i: GuideInput): string {if (i.os === "mac")return lines(@@ -137,9 +146,11 @@ function stepZero(i: GuideInput): string {"","1. Look at the chip:"," sysctl -n machdep.cpu.brand_string",+ "2. Look at the memory. The answer is in bytes: 17179869184 is 16 GB.",+ " sysctl -n hw.memsize"," Fuobe's first pictures need Apple silicon (M1 or newer) with 16 GB of memory or more. On an Intel Mac, tell the person plainly that pictures are very slow there.",- `2. With no usable GPU, Fuobe also runs with the person's own fal.ai or Replicate key (${i.site}/settings, then Your keys). Say so before a long install.`,- "3. If ComfyUI is not installed, the easiest way is ComfyUI Desktop for Apple silicon: https://www.comfy.org/download . Ask the person first. They download it, open it and follow its steps. ComfyUI Desktop uses port 8000.",+ `3. With no usable GPU, Fuobe also runs with the person's own fal.ai or Replicate key (${i.site}/settings, then Your keys). Say so before a long install.`,+ "4. If ComfyUI is not installed, the easiest way is ComfyUI Desktop for Apple silicon: https://www.comfy.org/download . Ask the person first. They download it, open it and follow its steps. ComfyUI Desktop uses port 8000.",);if (i.os === "linux")return lines(@@ -181,6 +192,10 @@ function findComfy(i: GuideInput): string {' Get-CimInstance Win32_Process -Filter "ProcessId=1234" | Select-Object -ExpandProperty CommandLine',' Get-CimInstance Win32_Process -Filter "ProcessId=1234" | Select-Object -ExpandProperty ExecutablePath'," If the command line has --base-directory <folder>, that folder holds custom_nodes and models. If not, custom_nodes and models are next to main.py.",+ "7. If main.py has no drive letter in front of it (for example ComfyUI\\main.py, as the portable build and Easy-Install start it), it is in ComfyUI's working folder. For the portable build and Easy-Install, that is the folder that holds python_embeded. This command shows it (put the number from item 5 in place of 1234). main.py is in that folder, or in its ComfyUI folder:",+ ' Split-Path (Split-Path (Get-CimInstance Win32_Process -Filter "ProcessId=1234").ExecutablePath)',+ " If the program is in a virtual environment (venv\\Scripts\\python.exe), the working folder is most often the one that holds venv: go one folder up from the answer.",+ `8. ${CPU_FLAG.windows}`,"","Common places for custom_nodes:","- Portable: ComfyUI_windows_portable\\ComfyUI\\custom_nodes",@@ -194,8 +209,9 @@ function findComfy(i: GuideInput): string {"4. Find the program on that port and the folder it runs in. Put the port in place of 8188, and the number that the first command shows in place of PID:"," lsof -nP -iTCP:8188 -sTCP:LISTEN"," ps -o command= -p PID",- " lsof -a -p PID -d cwd -Fn | tail -1",+ " lsof -a -p PID -d cwd -Fn | sed -n 's/^n//p'"," If the command has --base-directory <folder>, that folder holds custom_nodes and models. If not, custom_nodes and models are next to main.py.",+ `5. ${CPU_FLAG.mac}`,"","Common places for custom_nodes:","- ComfyUI Desktop: ~/Documents/ComfyUI/custom_nodes, unless the person chose another folder",@@ -212,6 +228,7 @@ function findComfy(i: GuideInput): string {"4. If ComfyUI runs as a service or in Docker, the setting goes into the start command of that service or container. Ask the person before you change a service or a container.",i.way === "connect" &&"4. If ComfyUI runs in Docker, custom_nodes is the folder that the container maps to its custom_nodes. Ask the person which folder that is.",+ `${i.way === "address" ? 4 : 5}. ${CPU_FLAG.linux}`,"","Common places for custom_nodes:","- A git install: ~/ComfyUI/custom_nodes",diff --git a/src/lib/ai-setup/next-step.ts b/src/lib/ai-setup/next-step.tsindex d79ab6e6..989cb901 100644--- a/src/lib/ai-setup/next-step.ts+++ b/src/lib/ai-setup/next-step.ts@@ -79,7 +79,18 @@ const CPU_HOW: Record<Os, string[]> = {other: ["If the computer has a graphics card, ComfyUI's PyTorch can't use it. Install the PyTorch build for that card, as ComfyUI's own page shows (https://github.com/comfyanonymous/ComfyUI)."],};-const OWN_KEY = "With no usable graphics card, Fuobe also runs with the person's own fal.ai or Replicate key: {site}/settings, then Your keys.";+/** ComfyUI was started with --cpu: start it again without it (guide Step 1 says where the flag is). */+const CPU_FLAG_HOW = (os: Os, way: Way): string[] => [+ "ComfyUI was started with --cpu. Start it again without --cpu. Guide Step 1 says where the flag is.",+ ...(os === "windows"+ ? [+ "Portable: close ComfyUI's window, then start ComfyUI with run_nvidia_gpu.bat, not run_cpu.bat. Another start file: start ComfyUI with the same line without --cpu, from a new start file (don't change the person's own).",+ ...(way === "direct" ? ["Then run Fuobe's start file again (guide Step 3), so that Start ComfyUI for Fuobe.bat starts it without --cpu."] : []),+ ]+ : ["Started from a terminal: the same command without --cpu. Stability Matrix: remove it in Launch Options."]),+];++const OWN_KEY ="With no usable graphics card, Fuobe also runs with the person's own fal.ai or Replicate key: {site}/settings, then Your keys.";/** The page that ends a web address's setup on the computer: the box for the address, under the same code. */const ADDRESS_PAGE = `{site}${aiSetupHref("address")}`;@@ -308,11 +319,11 @@ export function nextOf(v: SetupView, now: number): NextStep {"cpu-only","ComfyUI runs on the computer's processor, not on a graphics card. Fuobe's picture models need a graphics card (the smallest, SDXL, needs 8 GB), so none fits, and on the processor one picture would take many minutes. Tell the person plainly. If the computer has a graphics card, make ComfyUI use it, restart ComfyUI (ask the person first), then check again.",[- ...(t.cpuFlag ? ["ComfyUI was started with --cpu. Start it again without --cpu."] : CPU_HOW[os]),+ ...(t.cpuFlag ? CPU_FLAG_HOW(os, way) : CPU_HOW[os]),...(way === "address" ? ["The web address stays the same while cloudflared runs: the person doesn't paste it again after ComfyUI restarts."] : []),OWN_KEY,],- 0,+ t.cpuFlag ? 1 : 0,);if (t.modelWhy === "setup")return say(diff --git a/tests/ai-setup-guide.test.ts b/tests/ai-setup-guide.test.tsindex 23ca2f65..1f2003b9 100644--- a/tests/ai-setup-guide.test.ts+++ b/tests/ai-setup-guide.test.ts@@ -101,7 +101,7 @@ describe("the guide", () => {it("Windows commands have no $ and no braces, so they also run through powershell.exe -Command", () => {for (const g of guides.filter((g) => g.os === "windows")) {for (const line of commands(g.text)) {- if (!/^ {3}(curl\.exe|Get-|New-Item|Start-Process|Select-String|Remove-Item|Stop-Process|Expand-Archive|Rename-Item|certutil|winget|cloudflared|git )/.test(line)) continue;+ if (!/^ {3}(curl\.exe|Get-|New-Item|Start-Process|Select-String|Remove-Item|Stop-Process|Expand-Archive|Rename-Item|Split-Path|certutil|winget|cloudflared|git )/.test(line)) continue;expect(line.replace("%{http_code}", ""), line).not.toMatch(/[$`{}]/);}expect(g.text).toContain("winget install --id Cloudflare.cloudflared -e --accept-source-agreements --accept-package-agreements".repeat(g.way === "address" ? 1 : 0));@@ -117,6 +117,34 @@ describe("the guide", () => {expect(g).not.toMatch(/Where-Object/);});+ it("reads ComfyUI's folder on every system, a Mac's memory, and where --cpu comes from, with numbered items in order", () => {+ const section = (t: string, from: string) => t.slice(t.indexOf(from), t.indexOf("\n## Step", t.indexOf(from) + 1));+ const numbers = (s: string) => s.split("\n").flatMap((l) => (/^(\d+)\. /.exec(l) ? [Number(/^(\d+)\. /.exec(l)![1])] : []));+ for (const g of guides.filter((g) => g.os !== "other")) {+ const step0 = section(g.text, "## Step 0:");+ const step1 = section(g.text, "## Step 1: Find ComfyUI");+ for (const s of [step0, step1]) expect(numbers(s), `${g.way}/${g.os}`).toEqual(numbers(s).map((_, i) => i + 1));+ if (g.os === "windows") {+ expect(step1).toContain("7. If main.py has no drive letter in front of it (for example ComfyUI\\main.py, as the portable build and Easy-Install start it), it is in ComfyUI's working folder.");+ expect(step1).toContain(' Split-Path (Split-Path (Get-CimInstance Win32_Process -Filter "ProcessId=1234").ExecutablePath)');+ expect(step1).toContain("8. If the command line has --cpu, ComfyUI runs on the processor only, never on the graphics card. The portable build's run_cpu.bat starts it with --cpu, and run_nvidia_gpu.bat starts it without.");+ expect(step1).toContain("and so does Fuobe's Start ComfyUI for Fuobe.bat");+ }+ if (g.os === "mac") {+ expect(step0).toContain(" sysctl -n machdep.cpu.brand_string");+ expect(step0).toContain("2. Look at the memory. The answer is in bytes: 17179869184 is 16 GB.\n sysctl -n hw.memsize");+ // The working folder alone, without lsof's field letter in front of it.+ expect(step1).toContain(" lsof -a -p PID -d cwd -Fn | sed -n 's/^n//p'");+ expect(step1).not.toContain("-Fn | tail");+ expect(step1).toContain("5. If the command has --cpu, ComfyUI runs on the processor only, never on the GPU.");+ }+ if (g.os === "linux") {+ expect(step1).toContain(" readlink /proc/PID/cwd");+ expect(step1).toContain(`${g.way === "address" ? 4 : 5}. If the command has --cpu, ComfyUI runs on the processor only, never on the graphics card.`);+ }+ }+ });+it("has the steps the status points to, from installing ComfyUI to the first model", () => {for (const g of guides.filter((g) => g.os !== "other")) {expect(g.text).toContain("## Step 0:");diff --git a/tests/ai-setup-status.test.ts b/tests/ai-setup-status.test.tsindex 1e2909d1..c0bcce7f 100644--- a/tests/ai-setup-status.test.ts+++ b/tests/ai-setup-status.test.ts@@ -208,6 +208,29 @@ describe("the steps and the next step", () => {expect(stepsOf(view({ comfy: "none" }))[0]).toMatchObject({ state: "todo" });});+ it("points a ComfyUI started with --cpu to the guide step that says where the flag is", () => {+ const facts = { comfy: "found", cors: "exact", guard: "guard", connected: true, model: "none", cpu: true, cpuFlag: true } as const;+ const byWay: Record<"direct" | "connect" | "address", [Partial<TabFacts>, Partial<SetupView>]> = {+ direct: [facts, {}],+ connect: [{ ...facts, cors: undefined, guard: "connect" }, {}],+ address: [{ address: "ok", model: "none", cpu: true, cpuFlag: true }, { server: { gpu: "link", online: true } }],+ };+ for (const way of ["direct", "connect", "address"] as const)+ for (const os of ["windows", "mac", "linux"] as const) {+ const [f, o] = byWay[way];+ const next = nextOf(view({ ...f, way }, { ...o, way, os }), NOW);+ expect(next.id, `${way}/${os}`).toBe("cpu-only");+ expect(next.guide).toBe(`${SITE}/api/setup/guide/${way}/${os}#step-1`);+ const how = next.how.join(" ");+ expect(how).toContain("ComfyUI was started with --cpu. Start it again without --cpu. Guide Step 1 says where the flag is.");+ expect(how.includes("run_nvidia_gpu.bat, not run_cpu.bat"), `${way}/${os}`).toBe(os === "windows");+ expect(how.includes("Start ComfyUI for Fuobe.bat starts it without --cpu"), `${way}/${os}`).toBe(os === "windows" && way === "direct");+ expect(how.includes("the same command without --cpu"), `${way}/${os}`).toBe(os !== "windows");+ }+ // Without the flag (a PyTorch that can't use the card): Step 0, as before.+ expect(nextOf(view({ ...facts, cpuFlag: false }), NOW).guide).toBe(`${SITE}/api/setup/guide/direct/windows#step-0`);+ });+it("says a web address's ComfyUI runs on the processor, not that its GPU is too small", () => {const v = view({ way: "address", address: "ok", model: "none", modelWhy: "small", cpu: true }, { server: { gpu: "link", online: true } });expect(stepsOf(v)[2]).toMatchObject({ id: "model", state: "warn", detail: "ComfyUI runs on the processor" });diff --git a/tests/e2e/computer-mode.mjs b/tests/e2e/computer-mode.mjsindex d5f76e29..344a1970 100644--- a/tests/e2e/computer-mode.mjs+++ b/tests/e2e/computer-mode.mjs@@ -157,9 +157,10 @@ try {// The link, the second choice, fits inside the dialog.const linkToggle = dialog.getByRole("button", { name: /Keep it running with this tab closed/ });await linkToggle.click();- const field = await until(() => dialog.locator("input").first().boundingBox(), 10_000);+ const field = await until(() => dialog.locator("input").last().boundingBox(), 10_000);const box = await dialog.boundingBox();check("the link form fits inside the dialog", !!field && !!box && field.x + field.width <= box.x + box.width - 16, JSON.stringify({ field, box }));+ check("pairing with a code is offered there too", await dialog.getByText("Pair your ComfyUI with a code", { exact: true }).isVisible());await page.screenshot({ path: path.join(shots, "1b-link.png") });await linkToggle.click();await dialog.getByRole("button", { name: "Find my ComfyUI" }).click();