@aryacode/dsh-arya-image-gen 0.0.0-stage → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +24 -0
  3. package/README.md +292 -2
  4. package/cordis.patch.yml +5 -0
  5. package/docs/workflows/arya-qwen-image-pack.zip +0 -0
  6. package/docs/workflows/qwen-image-compose.json +1 -0
  7. package/docs/workflows/qwen-image-create.json +142 -0
  8. package/docs/workflows/qwen-image-cutout.json +142 -0
  9. package/docs/workflows/qwen-image-edit.json +1 -0
  10. package/docs/workflows/qwen-image-remove-bg.json +1 -0
  11. package/icon.svg +7 -0
  12. package/lib/agent-toolset.js +51 -0
  13. package/lib/client.js +127081 -0
  14. package/lib/index.js +28598 -0
  15. package/lib/types/agent-preset/billion-context.d.ts +150 -0
  16. package/lib/types/agent-preset/definition.d.ts +75 -0
  17. package/lib/types/agent-preset/persona.d.ts +10 -0
  18. package/lib/types/agent-preset/register.d.ts +40 -0
  19. package/lib/types/agent-preset/toolset.d.ts +36 -0
  20. package/lib/types/baoyu-compose.d.ts +59 -0
  21. package/lib/types/canvas-asset-route.d.ts +12 -0
  22. package/lib/types/canvas-state-route.d.ts +37 -0
  23. package/lib/types/canvas-state.d.ts +80 -0
  24. package/lib/types/canvas-tools.d.ts +44 -0
  25. package/lib/types/client/browser-image-utils.d.ts +23 -0
  26. package/lib/types/client/conversation-image-revisions.d.ts +24 -0
  27. package/lib/types/client/conversation-regenerate.d.ts +8 -0
  28. package/lib/types/client/gallery-store.d.ts +137 -0
  29. package/lib/types/client/gallery-view.d.ts +255 -0
  30. package/lib/types/client/generation-activity.d.ts +62 -0
  31. package/lib/types/client/image-cache.d.ts +26 -0
  32. package/lib/types/client/image-ref.d.ts +31 -0
  33. package/lib/types/client/image-result-node.d.ts +81 -0
  34. package/lib/types/client/index.d.ts +113 -0
  35. package/lib/types/client/inspiration-catalog-cache.d.ts +4 -0
  36. package/lib/types/client/inspiration-image-cache.d.ts +3 -0
  37. package/lib/types/client/inspiration-style.d.ts +1 -0
  38. package/lib/types/client/inspiration-view.d.ts +9 -0
  39. package/lib/types/client/multi-model-compare.d.ts +20 -0
  40. package/lib/types/client/settings-state.d.ts +12 -0
  41. package/lib/types/client/settings-write.d.ts +4 -0
  42. package/lib/types/client/studio-style.d.ts +1 -0
  43. package/lib/types/client/studio-view.d.ts +48 -0
  44. package/lib/types/client/tl/canvas-selection.d.ts +13 -0
  45. package/lib/types/client/tl/canvas-sync.d.ts +30 -0
  46. package/lib/types/client/tl/conversation-landings.d.ts +48 -0
  47. package/lib/types/client/tl/css-supports-shim.d.ts +21 -0
  48. package/lib/types/client/tl/gallery-canvas-button.d.ts +10 -0
  49. package/lib/types/client/tl/gallery-image-transfer.d.ts +12 -0
  50. package/lib/types/client/tl/studio-tl-canvas.d.ts +16 -0
  51. package/lib/types/client/tl/tl-brand-theme.d.ts +10 -0
  52. package/lib/types/client/tl/tl-brand-tokens.d.ts +24 -0
  53. package/lib/types/client/tl/tl-canvas-bridge.d.ts +39 -0
  54. package/lib/types/client/tl/tl-css.d.ts +2 -0
  55. package/lib/types/client/tl/tl-theme-css.d.ts +17 -0
  56. package/lib/types/comfyui-progress.d.ts +78 -0
  57. package/lib/types/comfyui-server-route.d.ts +10 -0
  58. package/lib/types/comfyui-server.d.ts +61 -0
  59. package/lib/types/comfyui-workflow.d.ts +80 -0
  60. package/lib/types/comfyui.d.ts +52 -0
  61. package/lib/types/config.d.ts +87 -0
  62. package/lib/types/fetch-diagnostics.d.ts +10 -0
  63. package/lib/types/generated/default-workflows.d.ts +16 -0
  64. package/lib/types/image-route.d.ts +35 -0
  65. package/lib/types/image-tool-context.d.ts +3 -0
  66. package/lib/types/import-route.d.ts +16 -0
  67. package/lib/types/index.d.ts +16 -0
  68. package/lib/types/inspiration-route.d.ts +6 -0
  69. package/lib/types/inspiration.d.ts +92 -0
  70. package/lib/types/progress-route.d.ts +10 -0
  71. package/lib/types/redact.d.ts +2 -0
  72. package/lib/types/reference-image.d.ts +56 -0
  73. package/lib/types/reference-import.d.ts +66 -0
  74. package/lib/types/save-generated.d.ts +83 -0
  75. package/lib/types/settings-health.d.ts +6 -0
  76. package/lib/types/shared.d.ts +519 -0
  77. package/lib/types/studio-route.d.ts +15 -0
  78. package/lib/types/studio.d.ts +14 -0
  79. package/lib/types/validate-workflows.d.ts +48 -0
  80. package/lib/types/workspace-save.d.ts +103 -0
  81. package/package.json +143 -5
  82. package/skills/arya-image-references/SKILL.md +74 -0
  83. package/skills/arya-image-workflows/SKILL.md +75 -0
  84. package/skills/install-arya-image-gen/SKILL.md +28 -0
@@ -0,0 +1,103 @@
1
+ import type { StudioWorkspaceInfo } from './shared.js';
2
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
3
+ /**
4
+ * Build the deterministic file name for a generated image:
5
+ * `image-<digest-prefix>.<ext>`. The digest prefix comes from the
6
+ * content-addressed attachment id, so the same image bytes always map to the
7
+ * same file name regardless of when they were generated, and re-saving simply
8
+ * overwrites the previous copy in place.
9
+ * @param attachmentId - durable attachment id (`sha256:<hex>`).
10
+ * @param mediaType - verified image media type.
11
+ * @returns the file name (no directory).
12
+ */
13
+ export declare function workspaceImageName(attachmentId: string, mediaType: ImageAttachmentRef['mediaType']): string;
14
+ /**
15
+ * Resolve the configured image folder inside the session workspace. The
16
+ * folder may nest, but must stay inside the workspace: absolute paths and
17
+ * parent-traversal segments are rejected for both separator styles.
18
+ *
19
+ * This lexical pass is necessary but not sufficient: `saveImageToWorkspace`
20
+ * additionally verifies the on-disk resolution so symlinked folders cannot
21
+ * escape the workspace.
22
+ * @param workspaceRoot - the session workspace directory.
23
+ * @param folder - configured subfolder; empty/blank means the workspace root.
24
+ * @returns the absolute image directory.
25
+ * @throws when the folder would escape the workspace root.
26
+ */
27
+ export declare function workspaceImageDir(workspaceRoot: string, folder: string | undefined): string;
28
+ /**
29
+ * Write one generated image durably under the session workspace.
30
+ *
31
+ * Containment is enforced twice: lexically by `workspaceImageDir`, then
32
+ * against real paths, so a configured folder (or any intermediate segment)
33
+ * that is a symlink pointing outside the workspace is rejected before and
34
+ * after anything is created.
35
+ *
36
+ * The bytes are written to a same-directory staging file and renamed onto the
37
+ * target, so a crash never leaves a half-written image under its final name.
38
+ * Re-saving identical bytes rewrites the same file (the name is content-
39
+ * addressed), which keeps repeated generations idempotent. A cancellation is
40
+ * honoured up to and including the final rename: an aborted save never
41
+ * resolves successfully and never leaves the image behind under its final
42
+ * name.
43
+ * @param options - workspace root, configured folder, attachment identity, and image bytes.
44
+ * @returns the absolute path of the written file.
45
+ */
46
+ export declare function saveImageToWorkspace(options: {
47
+ workspaceRoot: string;
48
+ folder?: string | undefined;
49
+ attachmentId: string;
50
+ mediaType: ImageAttachmentRef['mediaType'];
51
+ data: Uint8Array;
52
+ signal?: AbortSignal;
53
+ }): Promise<string>;
54
+ /**
55
+ * Persist one downloaded reference image under `<folder>/references`.
56
+ *
57
+ * Same containment rules as `saveImageToWorkspace`: the directory may nest but
58
+ * must resolve inside the workspace, checked lexically and again on disk. The
59
+ * file name is caller-chosen (a reference is not content-addressed like a
60
+ * generated image), with a numeric suffix when that name is already taken, so
61
+ * two references to different pictures never overwrite each other.
62
+ *
63
+ * @param options - workspace root, folder, bytes, media type and file name.
64
+ * @returns the absolute path of the written file.
65
+ */
66
+ export declare function saveReferenceImageToWorkspace(options: {
67
+ workspaceRoot: string;
68
+ folder?: string | undefined;
69
+ data: Uint8Array;
70
+ mediaType: ImageAttachmentRef['mediaType'];
71
+ name: string;
72
+ signal?: AbortSignal | undefined;
73
+ }): Promise<string>;
74
+ /** Discover all DSH workspace paths recorded in local application storage. */
75
+ export declare function getDshWorkspaceRoots(): Promise<string[]>;
76
+ /** Discover detailed workspace records from DSH workspace.json storage. */
77
+ export declare function getDshWorkspacesFull(): Promise<StudioWorkspaceInfo[]>;
78
+ /**
79
+ * Verify whether a candidate path lives within an allowed DSH workspace root.
80
+ * Resolves symlinks via `realpath` to prevent symlink traversal attacks.
81
+ * @returns the canonical realpath of the candidate root.
82
+ * @throws when candidateRoot does not exist or falls outside the allowed roots.
83
+ */
84
+ export declare function assertWorkspaceAllowed(candidateRoot: string, allowedRoots: Iterable<string>): Promise<string>;
85
+ /**
86
+ * Safely delete a generated image file from workspace disk by its path.
87
+ * Enforces strict safety gates:
88
+ * 1. Base name must match generated image pattern (`image-<hex>.<ext>`) to avoid touching user files.
89
+ * 2. Path must be a regular file and NOT a symbolic link.
90
+ * 3. Real canonical path's basename must also match the pattern.
91
+ * 4. Real canonical path must reside within an allowed workspace root (or process.cwd()).
92
+ */
93
+ export declare function deleteImageFromWorkspace(filePath: string, allowedWorkspaceRoots?: Iterable<string>): Promise<boolean>;
94
+ /**
95
+ * Safely find and delete a generated image file by its attachment ID within a single workspace root.
96
+ * Strictly checks sha256:64hex format and avoids scanning unrelated workspaces.
97
+ * Only used as fallback for historical images where savedTo was not persisted.
98
+ */
99
+ export declare function deleteImageByAttachmentIdFromWorkspace(attachmentId: string, options?: {
100
+ workspaceRoot?: string | undefined;
101
+ folder?: string | undefined;
102
+ allowedWorkspaceRoots?: Iterable<string> | undefined;
103
+ }): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,144 @@
1
1
  {
2
- "name": "@aryacode/dsh-arya-image-gen",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@aryacode/dsh-arya-image-gen",
3
+ "version": "0.20.1",
4
+ "description": "ComfyUI-native image generation for DeepSeek Harness: chat tools, creative canvas, Studio workbench, workflow comparison, and built-in server control.",
5
+ "type": "module",
6
+ "author": "AryaCode",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/KonnectSuite/dsh-arya-image-gen.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/KonnectSuite/dsh-arya-image-gen/issues"
13
+ },
14
+ "homepage": "https://github.com/KonnectSuite/dsh-arya-image-gen#readme",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "main": "lib/index.js",
19
+ "types": "lib/types/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./lib/types/index.d.ts",
23
+ "default": "./lib/index.js"
24
+ },
25
+ "./client": {
26
+ "types": "./lib/types/client/index.d.ts",
27
+ "default": "./lib/client.js"
28
+ },
29
+ "./agent-toolset": {
30
+ "types": "./lib/types/agent-preset/toolset.d.ts",
31
+ "default": "./lib/agent-toolset.js"
32
+ },
33
+ "./icon": "./icon.svg",
34
+ "./package.json": "./package.json"
35
+ },
36
+ "files": [
37
+ "lib/index.js",
38
+ "lib/client.js",
39
+ "lib/agent-toolset.js",
40
+ "lib/types/**/*.d.ts",
41
+ "skills/**/*.md",
42
+ "cordis.patch.yml",
43
+ "README.md",
44
+ "docs/workflows/*",
45
+ "icon.svg",
46
+ "LICENSE",
47
+ "NOTICE"
48
+ ],
49
+ "dsh": {
50
+ "bundle": {
51
+ "patch": "./cordis.patch.yml"
52
+ },
53
+ "engines": {
54
+ "dsh": ">=0.1.7 <1"
55
+ },
56
+ "client": {
57
+ "inject": [
58
+ "@deepseek-ai/dsh-client-connection",
59
+ "@deepseek-ai/dsh-api-remotes",
60
+ "@deepseek-ai/dsh-client-ui-conversation",
61
+ "@deepseek-ai/dsh-client-ui-settings",
62
+ "@deepseek-ai/dsh-client-ui-settings-plugins",
63
+ "@deepseek-ai/dsh-client-ui-sidebar-right",
64
+ "@deepseek-ai/dsh-client-ui-tool",
65
+ "@deepseek-ai/dsh-client-locale"
66
+ ],
67
+ "platform": "web"
68
+ }
69
+ },
70
+ "scripts": {
71
+ "typecheck": "tsc --noEmit",
72
+ "build": "node scripts/sync-default-workflows.mjs && tsc && tsdown",
73
+ "prepare": "pnpm run build",
74
+ "test": "vitest run",
75
+ "test:package": "node scripts/check-package.mjs",
76
+ "pack:check": "pnpm pack --dry-run",
77
+ "sync:workflows": "node scripts/sync-default-workflows.mjs"
78
+ },
79
+ "engines": {
80
+ "node": "^22.19.0 || >=24.0.0",
81
+ "dsh": ">=0.1.7 <1"
82
+ },
83
+ "license": "Apache-2.0",
84
+ "keywords": [
85
+ "deepseek",
86
+ "deepseek-harness",
87
+ "dsh",
88
+ "dsh-plugin",
89
+ "comfyui",
90
+ "comfyui-workflow",
91
+ "image-generation",
92
+ "ai-image-generation",
93
+ "local-ai",
94
+ "workflow"
95
+ ],
96
+ "peerDependencies": {
97
+ "@deepseek-ai/cordis": ">=4.0.0 <5",
98
+ "@deepseek-ai/schemastery": ">=3.18.4 <4",
99
+ "react": ">=18.2.0 <19"
100
+ },
101
+ "peerDependenciesMeta": {
102
+ "@deepseek-ai/cordis": {
103
+ "optional": true
104
+ },
105
+ "@deepseek-ai/schemastery": {
106
+ "optional": true
107
+ },
108
+ "react": {
109
+ "optional": true
110
+ }
111
+ },
112
+ "devDependencies": {
113
+ "@deepseek-ai/cordis": "4.0.4",
114
+ "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
115
+ "@deepseek-ai/dsh-api-remotes": "0.1.7-rc.2",
116
+ "@deepseek-ai/dsh-attachment": "0.1.7-rc.2",
117
+ "@deepseek-ai/dsh-client-connection": "0.1.7-rc.2",
118
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.7-rc.2",
119
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.2",
120
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.7-rc.2",
121
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.1.7-rc.2",
122
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
123
+ "@deepseek-ai/dsh-client-ui-tool": "0.1.7-rc.2",
124
+ "@deepseek-ai/dsh-credentials": "0.1.7-rc.2",
125
+ "@deepseek-ai/dsh-host-webserver": "0.1.7-rc.2",
126
+ "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
127
+ "@deepseek-ai/dsh-session": "0.1.7-rc.2",
128
+ "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
129
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
130
+ "@deepseek-ai/dsh-workspace": "0.1.7-rc.2",
131
+ "@deepseek-ai/schemastery": "3.18.4",
132
+ "@types/node": "^22.20.0",
133
+ "@types/react": "~18.3.1",
134
+ "lucide-react": "^1.38.0",
135
+ "react": "^18.2.0",
136
+ "react-dom": "18.3.1",
137
+ "tldraw": "5.3.0",
138
+ "tsdown": "^0.22.2",
139
+ "typescript": "^6.0.3",
140
+ "unrun": "^0.3.1",
141
+ "vitest": "^4.1.8"
142
+ },
143
+ "packageManager": "pnpm@11.7.0"
144
+ }
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: arya-image-references
3
+ description: Ground image work in a real reference photo when the request names something specific or real - a product, a landmark, a vehicle, a brand logo, a uniform, a public figure - by searching the web for the actual subject, importing the picture into the workspace, and editing from it. Use it whenever an accurate likeness matters more than a plausible one, or when a description alone would make the model invent details.
4
+ ---
5
+
6
+ # Reference images for real subjects
7
+
8
+ A text prompt can describe a thing; it cannot reproduce it. For anything that
9
+ already exists in the world, one real photograph produces a far more accurate
10
+ image than a paragraph, and it stops the model from inventing the details it
11
+ cannot know - the exact badge layout on a car, which way a landmark's arches
12
+ run, the specific shade of a brand's green.
13
+
14
+ ## When a reference is worth it
15
+
16
+ | the request | reference? |
17
+ |---|---|
18
+ | a real product, machine, vehicle, aircraft, building | yes - the real subject |
19
+ | a brand logo or wordmark | yes - official artwork only |
20
+ | a uniform, kit, badge or insignia | yes - an authoritative photo |
21
+ | a public figure's likeness | only a photo the user themselves supplied; never scrape a private person |
22
+ | a fictional character | optional - fan art and official sheets, credit the source |
23
+ | a generic scene, mood or style | no - a description is better and cheaper |
24
+ | exact legible text in the image | no - that is not a reference problem; say so instead of faking it |
25
+
26
+ ## The loop
27
+
28
+ 1. **Search** with the host's `web_search` for the subject plus a source hint:
29
+ `"Eiffel Tower" official photos site:paris convention bureau`, `"F-35A" tail
30
+ number photo site:af.mil`. Official, manufacturer, government, museum and
31
+ press pages beat stock sites, which are watermarked and often re-coloured.
32
+ 2. **Follow** the best result with `web_fetch` and read the page for a candidate
33
+ image URL - `og:image`, a `src`/`srcset` in a hero image, or a press-kit link.
34
+ The search page itself is not an image; do not hand its URL to the importer.
35
+ 3. **Import** each candidate with `import_reference_image`:
36
+
37
+ ```
38
+ import_reference_image(url="https://…/externalContent/…/eiffel-tower.jpg", name="eiffel-tower")
39
+ ```
40
+
41
+ It answers with a workspace `path`, the real media type, byte size and pixel
42
+ dimensions. Two failures are normal and both are informative: `did not return
43
+ a PNG, JPEG or WebP image (text/html)` means you followed a page, not a file;
44
+ `private address` means the URL pointed somewhere the host refuses to fetch.
45
+ 4. **Edit from the reference** - the imported path is what `edit_image` takes:
46
+
47
+ ```
48
+ edit_image(source_path="C:/…/references/eiffel-tower.png", prompt="Keep the tower's proportions, tier spacing and arch shape exactly as in the reference; render it at dusk, warm interior lights on, seen from the Trocadéro gardens, no people.")
49
+ ```
50
+
51
+ Say what must stay and what may change. "Keep the subject from the reference"
52
+ plus the specific changes beats a long re-description of the subject, which
53
+ makes the model substitute a lookalike.
54
+ 5. **When two references matter** (a car from the front and the rear, a product
55
+ and its logo), import both and edit from the one that carries the shape; name
56
+ the other in the prompt. ComfyUI edits the first source image only.
57
+
58
+ ## Rules
59
+
60
+ - **Import at most three references** and pick the one that shows the subject
61
+ clearly: sharp, unwatermarked, the right variant. More inputs do not improve
62
+ an image-to-image pass.
63
+ - **Credit and be honest.** Name the pages you used in your reply, and do not
64
+ claim the output is a photograph of the real thing; it is an interpretation
65
+ built from a reference.
66
+ - **Respect the limits you can see.** Do not reproduce a living private person,
67
+ a copyrighted character sheet as if it were official art, or a competitor's
68
+ logo as the user's own. If the request needs permission, say so.
69
+ - **No web tools?** Ask the user to attach the picture instead of inventing the
70
+ subject. The `Arya Image` preset keeps `web_search`/`web_fetch` only when the
71
+ composition provides them; a headless or offline host has none.
72
+ - **Never silently fall back** from "the real Eiffel Tower" to "an
73
+ Eiffel-Tower-ish tower" when the reference search failed. Say it failed and
74
+ offer to try another source.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: arya-image-workflows
3
+ description: Choose the right ComfyUI workflow in Arya Image Gen instead of inheriting whatever was active. Use when a request implies a specific task or look - cutout, background removal, editing an existing image, a particular aspect ratio - or when generate_image/edit_image fails because a workflow cannot do what was asked.
4
+ ---
5
+
6
+ # Choosing a workflow
7
+
8
+ **ComfyUI is the only route.** Use `generate_image`, `generate_images` and
9
+ `edit_image` for every image request. The plugin has no HTML or SVG rasterizer:
10
+ when a request is really a layout job — exact, legible text, tables, a poster
11
+ whose words must be perfect — say plainly that a diffusion model cannot
12
+ guarantee lettering, and describe the workflow's limit instead of drifting.
13
+
14
+ If a ComfyUI call fails with a connection error, the server is down or
15
+ unreachable: say so and offer to start it (Settings → Plugins → Arya Image Gen →
16
+ Server → **Start**; on the machine that runs it, a Windows scheduled task or the
17
+ Python path in that card). Do not silently produce the image another way.
18
+
19
+ The plugin already picks by role: generation resolves the active text-to-image
20
+ workflow, `edit_image` resolves the active image-to-image one. Role is not the
21
+ same as *intent*, though — two text-to-image workflows can differ in model, speed
22
+ and output, and only you can tell which the user asked for.
23
+
24
+ ## Look before you pick
25
+
26
+ `list_workflows` reports every configured workflow with:
27
+
28
+ - `role` — text-to-image or image-to-image,
29
+ - `adjustable` — whether a call may set width, height, steps, cfg,
30
+ - `bakedSize` — the fixed size when it takes no size parameters,
31
+ - `active` — what that role would pick without being named.
32
+
33
+ Call it when the request names a task ("cut out the subject"), a size, or a
34
+ tradeoff ("fast draft"). Skip it for an ordinary prompt on the defaults.
35
+
36
+ ## Matching intent
37
+
38
+ | the user asks for | pass |
39
+ |---|---|
40
+ | a picture from a description | nothing — the active text workflow is right |
41
+ | a specific aspect ratio or size | `width`/`height`, if that workflow is `adjustable`; otherwise name an adjustable workflow or say it is fixed |
42
+ | a cutout / transparent subject | the cutout workflow by name |
43
+ | background removal from their image | the remove-background workflow, with `edit_image` |
44
+ | "edit / restyle / change this photo" | `edit_image`; the edit workflow is chosen for you |
45
+ | "put this chair in my living room", "this product on that table" — a subject plus a scene | the compose workflow, with both references in order |
46
+ | speed over detail | the fastest workflow, named explicitly |
47
+
48
+ ## Several references at once
49
+
50
+ A workflow that declares `{{images}}` takes any number of references, in the
51
+ order you pass them; a workflow with `{{image}}` takes exactly one and refuses
52
+ extras with a message that names the fix. Hand the compose workflow its images
53
+ in the order you describe them — subject first, scene second:
54
+
55
+ ```
56
+ edit_image(workflow="Qwen Image 2.1 - compose (any number of references)",
57
+ source_paths=["…/references/chair.jpg", "…/references/living-room.jpg"],
58
+ prompt="Keep the chair's shape, fabric and colour from image 1 exactly; place it in the room of image 2 on the floor by the window, matching that room's light and shadow. Do not restyle the chair.")
59
+ ```
60
+
61
+ Two or three references is the useful range; more inputs dilute the identity you
62
+ asked to keep, and the encoder stops at 16 slots.
63
+
64
+ ## Rules
65
+
66
+ - **Name workflows that `list_workflows` reported.** A made-up name fails.
67
+ - **Never name a workflow from the other role.** `edit_image` needs one with an
68
+ `{{image}}` input; naming a text workflow produces an error that names the
69
+ right one.
70
+ - **Do not pass size parameters to a workflow that bakes size.** The error says
71
+ so; either drop them or name an adjustable workflow.
72
+ - **Say which one you used** in your reply when it was not the default, and why —
73
+ the user cannot see the choice otherwise.
74
+ - If no workflow matches what was asked (no cutout configured, say), say that and
75
+ offer the closest alternative instead of silently producing something else.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: install-arya-image-gen
3
+ description: Install, configure, verify, or remove the @aryacode/dsh-arya-image-gen Bundle (ComfyUI-only image generation) in a DeepSeek Harness Web profile. Use when a user wants local ComfyUI image generation in DSH, cannot find the image settings card, needs to import a ComfyUI API workflow, or needs help starting the ComfyUI server.
4
+ ---
5
+
6
+ # Install Arya Image Gen
7
+
8
+ 0. If the user has no ComfyUI yet, point them at `docs/install-comfyui.md` in this repository before anything else.
9
+ 1. Confirm `dsh` runs and record `dsh --version`.
10
+ 2. Ask which Web profile to change if the user did not name one. Default to `web` only when that profile already exists.
11
+ 3. Install the pinned package or repository spec the user provides:
12
+
13
+ ```sh
14
+ dsh plugin --profile <profile> add @aryacode/dsh-arya-image-gen
15
+ ```
16
+
17
+ 4. If pnpm blocks the Git dependency's `prepare` script, explain that the allowance executes repository code during installation. Add only the exact package key pnpm reports to the profile's `pnpm-workspace.yaml`, then retry after the user approves.
18
+ 5. Verify `dsh --profile <profile> --dump-config` contains the `@aryacode/dsh-arya-image-gen` layer and `image-gen` row.
19
+ 6. Start the profile. If its port is already in use, identify the existing DSH process before stopping anything.
20
+ 7. Open the Plugins panel from the left sidebar, click Arya Image Gen under Installed, and on the plugin page:
21
+ - Set the ComfyUI endpoint (default `http://127.0.0.1:8188`).
22
+ - Import a ComfyUI API-format workflow JSON containing `{{prompt}}` (and `{{image}}` for editing).
23
+ - Workflows land in Text to image or Image to image automatically; each group keeps its own active workflow, and a role can be overridden in the row.
24
+ - To let a call change size or sampling, put `{{width}}`/`{{height}}`/`{{steps}}`/`{{cfg}}` on numeric inputs; one templated workflow then covers every size.
25
+ - Use Start / Stop / Restart to control the local ComfyUI process, or configure the Python path, ComfyUI directory, extra arguments, and auto-start.
26
+ 8. Test with a simple prompt. Confirm one `generate_image` call succeeds and its image renders in the conversation.
27
+
28
+ For removal, run `dsh plugin --profile <profile> remove @aryacode/dsh-arya-image-gen`. Do not delete the user's ComfyUI installation or gallery data unless they explicitly request it.