briyah 1.3.4 → 1.3.5
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.
- package/README.md +65 -0
- package/data/common/config/comfyui-workflows/flux-kontext.edit.json +98 -0
- package/data/common/config/comfyui-workflows/flux-kontext.t2i.json +80 -0
- package/data/common/config/comfyui-workflows/flux2-dev.edit.json +125 -0
- package/data/common/config/comfyui-workflows/flux2-dev.t2i.json +96 -0
- package/data/common/config/image_models_full.json +186 -99
- package/data/common/config/markup +1 -1
- package/dist-sdk/server/src/ai/LLM/base-ai.service.d.ts +1 -0
- package/dist-sdk/server/src/ai/LLM/base-ai.service.js +4 -2
- package/dist-sdk/server/src/ai/LLM/base-ai.service.spec.d.ts +1 -0
- package/dist-sdk/server/src/ai/LLM/base-ai.service.spec.js +89 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-client.d.ts +29 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-client.js +142 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-client.spec.d.ts +1 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-client.spec.js +143 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.d.ts +19 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.js +217 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.spec.d.ts +1 -0
- package/dist-sdk/server/src/ai/LLM/comfyui-workflow.spec.js +207 -0
- package/dist-sdk/server/src/ai/LLM/comfyui.module.d.ts +2 -0
- package/dist-sdk/server/src/ai/LLM/comfyui.module.js +21 -0
- package/dist-sdk/server/src/ai/LLM/comfyui.service.d.ts +26 -0
- package/dist-sdk/server/src/ai/LLM/comfyui.service.js +191 -0
- package/dist-sdk/server/src/ai/LLM/mock.service.d.ts +1 -0
- package/dist-sdk/server/src/ai/LLM/mock.service.js +3 -0
- package/dist-sdk/server/src/ai/LLM/self-hosted.module.d.ts +2 -0
- package/dist-sdk/server/src/ai/LLM/self-hosted.module.js +21 -0
- package/dist-sdk/server/src/ai/LLM/self-hosted.service.d.ts +13 -0
- package/dist-sdk/server/src/ai/LLM/self-hosted.service.js +205 -0
- package/dist-sdk/server/src/ai/ai-factory.module.js +4 -0
- package/dist-sdk/server/src/ai/ai-factory.service.d.ts +5 -1
- package/dist-sdk/server/src/ai/ai-factory.service.js +16 -2
- package/dist-sdk/server/src/app.service.js +1 -1
- package/dist-sdk/server/src/sdk/briyah.js +9 -3
- package/dist-sdk/server/src/story/story.service.js +11 -0
- package/docs/classes/Agent.html +15 -15
- package/docs/classes/Briyah.html +14 -14
- package/docs/classes/BriyahConfigService.html +5 -5
- package/docs/classes/Room.html +27 -27
- package/docs/classes/RoomMessage.html +10 -10
- package/docs/enums/MessageAction.html +3 -3
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +47 -3
- package/docs/interfaces/AgentInfo.html +2 -2
- package/docs/interfaces/AgentMessagesResponse.html +2 -2
- package/docs/interfaces/AppService.html +119 -119
- package/docs/interfaces/Artifact.html +3 -3
- package/docs/interfaces/ArtifactMetadata.html +2 -2
- package/docs/interfaces/AttachDocumentResponse.html +2 -2
- package/docs/interfaces/BriyahConfigOptions.html +9 -9
- package/docs/interfaces/ChapterInfo.html +2 -2
- package/docs/interfaces/Character.html +2 -2
- package/docs/interfaces/CreateAgentResponse.html +2 -2
- package/docs/interfaces/CreateRoomResponse.html +2 -2
- package/docs/interfaces/CreateStoryResponse.html +2 -2
- package/docs/interfaces/FileList.html +2 -2
- package/docs/interfaces/FileMetadata.html +3 -3
- package/docs/interfaces/IConfigService.html +3 -3
- package/docs/interfaces/LoggingOptions.html +6 -6
- package/docs/interfaces/Message.html +2 -2
- package/docs/interfaces/ModelInfo.html +2 -2
- package/docs/interfaces/NativeToolDefinition.html +7 -7
- package/docs/interfaces/PreparedPromptResponse.html +2 -2
- package/docs/interfaces/ProcessTextResponse.html +2 -2
- package/docs/interfaces/PromptFile.html +2 -2
- package/docs/interfaces/PromptFileContent.html +2 -2
- package/docs/interfaces/PromptFilesResponse.html +2 -2
- package/docs/interfaces/PromptFolder.html +2 -2
- package/docs/interfaces/PromptFoldersResponse.html +2 -2
- package/docs/interfaces/RoomDetails.html +2 -2
- package/docs/interfaces/RoomInfo.html +2 -2
- package/docs/interfaces/RoomMessageUpdate.html +2 -2
- package/docs/interfaces/RoomMessagesResponse.html +2 -2
- package/docs/interfaces/SendMessageResult.html +2 -2
- package/docs/interfaces/StoryErrorEvent.html +3 -3
- package/docs/interfaces/StoryIdea.html +2 -2
- package/docs/interfaces/StoryInfo.html +3 -3
- package/docs/interfaces/StoryIntroduceCharacterEvent.html +3 -3
- package/docs/interfaces/StoryProgressChapterEvent.html +3 -3
- package/docs/interfaces/StoryState.html +5 -5
- package/docs/interfaces/StoryStateEvent.html +3 -3
- package/docs/interfaces/ToolDefinition.html +2 -2
- package/docs/interfaces/ToolHelpers.html +3 -3
- package/docs/interfaces/ToolParameter.html +2 -2
- package/docs/interfaces/ToolSummary.html +2 -2
- package/docs/interfaces/ToolsResponse.html +2 -2
- package/docs/interfaces/Transaction.html +2 -2
- package/docs/interfaces/TransactionHistoryResponse.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/types/PromptScope.html +1 -1
- package/docs/types/ToolContext.html +2 -2
- package/docs/types/ToolRunResult.html +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -122,6 +122,14 @@ interface BriyahConfigOptions {
|
|
|
122
122
|
- `TOGETHER_API_KEY` - For Together AI models
|
|
123
123
|
- `FAL_API_KEY` - For Fal image-generation models
|
|
124
124
|
|
|
125
|
+
**Self-hosted providers** (optional, count toward the "at least one" requirement):
|
|
126
|
+
- `SELF_HOSTED_BASE_URL` - OpenAI-compatible inference server for the `SelfHosted` text provider (vLLM, Ollama, llama.cpp, LM Studio). Must include the `/v1` path, e.g. `http://gpu-box:8000/v1`
|
|
127
|
+
- `SELF_HOSTED_API_KEY` - Optional bearer token for the above
|
|
128
|
+
- `COMFYUI_BASE_URL` - ComfyUI server for the `ComfyUI` image provider, no trailing slash, e.g. `http://gpu-box:8188` (see Example 9)
|
|
129
|
+
- `COMFYUI_EXTRA_HEADERS` - Optional JSON object of headers sent on every ComfyUI request, e.g. `{"Authorization":"Basic ..."}` for a reverse proxy
|
|
130
|
+
- `COMFYUI_TIMEOUT_MS` - Total wait for a queued generation, default `600000` (covers queue wait and model cold start)
|
|
131
|
+
- `COMFYUI_POLL_INTERVAL_MS` - Poll interval while waiting, default `2000`
|
|
132
|
+
|
|
125
133
|
**Optional:**
|
|
126
134
|
- `STARTING_BALANCE` - Starting balance for new users (e.g., "10.00")
|
|
127
135
|
- `BRIYAH_DATA_PATH` - Global default data path (overridden by constructor `dataPath`)
|
|
@@ -262,6 +270,10 @@ await appService.progressStory(storyId);
|
|
|
262
270
|
// Text Processing
|
|
263
271
|
const result = await appService.processText(agentId, text);
|
|
264
272
|
|
|
273
|
+
// Image Generation (image-capable providers; called on the Agent object — see Example 9)
|
|
274
|
+
const { artifactId } = await agent.generateImage(prompt, imageProperties);
|
|
275
|
+
const edited = await agent.editImage(prompt, imageProperties, referenceArtifactIds);
|
|
276
|
+
|
|
265
277
|
// File Attachments
|
|
266
278
|
const attachment = await appService.attachDocument(agentId, fileName, fileData);
|
|
267
279
|
await appService.deleteAttachedFile(agentId, fileName); // by filename
|
|
@@ -559,6 +571,59 @@ Agents can also delegate: an agent may respond with a `commission` action naming
|
|
|
559
571
|
|
|
560
572
|
User-authored (string-code) tools remain available via `createTool`/`updateTool`/`testTool` when `allowUserAuthoredTools` is enabled, for trusted single-user setups.
|
|
561
573
|
|
|
574
|
+
### Example 9: Self-Hosted Image Generation with ComfyUI
|
|
575
|
+
|
|
576
|
+
The `ComfyUI` provider generates images on a self-hosted [ComfyUI](https://github.com/comfyanonymous/ComfyUI) server. It is image-only: `generateImage`/`editImage` work, `textPrompt` throws. Set `COMFYUI_BASE_URL` to enable it. ComfyUI has no authentication of its own — keep it on a LAN/VPN or behind an authenticated reverse proxy (pass proxy credentials via `COMFYUI_EXTRA_HEADERS`).
|
|
577
|
+
|
|
578
|
+
For this provider the agent's *model name* selects a **workflow-template pair**, not a checkpoint. Two pairs ship by default:
|
|
579
|
+
|
|
580
|
+
| Pair name | Model | Files required on the ComfyUI server |
|
|
581
|
+
|---|---|---|
|
|
582
|
+
| `flux2-dev` | FLUX.2 dev (FP8 mixed) | `diffusion_models/flux2_dev_fp8mixed.safetensors`, `text_encoders/mistral_3_small_flux2_bf16.safetensors`, `vae/flux2-vae.safetensors` |
|
|
583
|
+
| `flux-kontext` | Flux.1 Kontext dev (FP8) | `diffusion_models/flux1-dev-kontext_fp8_scaled.safetensors`, `text_encoders/clip_l.safetensors` + `t5xxl_fp8_e4m3fn_scaled.safetensors`, `vae/ae.safetensors` |
|
|
584
|
+
|
|
585
|
+
`flux2-dev` has substantially better multi-reference character consistency and wants a 32 GB-class GPU; `flux-kontext` runs on 16 GB-class cards.
|
|
586
|
+
|
|
587
|
+
```typescript
|
|
588
|
+
import { Briyah } from 'briyah';
|
|
589
|
+
|
|
590
|
+
const briyah = new Briyah({ dataPath: './data/briyah', startingBalance: 10.00 });
|
|
591
|
+
await briyah.init();
|
|
592
|
+
|
|
593
|
+
const app = briyah.getAppService('user-123');
|
|
594
|
+
|
|
595
|
+
// Model name = workflow pair name
|
|
596
|
+
const artist = app.createAgent('ComfyUI', 'Artist', 'Artist',
|
|
597
|
+
'Image generation agent', 'flux2-dev');
|
|
598
|
+
|
|
599
|
+
// Text-to-image. Resolves to { artifactId } on success or { error } on failure.
|
|
600
|
+
const generated = await artist.generateImage(
|
|
601
|
+
'A lighthouse on a rocky coast at dusk',
|
|
602
|
+
{ width: 1024, height: 1024 } // optional; a fixed seed may also be passed
|
|
603
|
+
);
|
|
604
|
+
if (generated.error) throw new Error(String(generated.error));
|
|
605
|
+
|
|
606
|
+
// Generated images are stored as artifacts (PNG)
|
|
607
|
+
const png = artist.artifactService.getArtifact(generated.artifactId);
|
|
608
|
+
|
|
609
|
+
// Image-to-image with reference images. Each referenced artifact is uploaded
|
|
610
|
+
// and conditioned on separately (chained ReferenceLatent nodes). Order is
|
|
611
|
+
// preserved, so the prompt can refer to "Image 1", "Image 2", ...
|
|
612
|
+
const edited = await artist.editImage(
|
|
613
|
+
'The character from Image 2 stands in the setting from Image 1',
|
|
614
|
+
{ width: 1024, height: 1024 },
|
|
615
|
+
[sceneArtifactId, portraitArtifactId]
|
|
616
|
+
);
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
Notes:
|
|
620
|
+
|
|
621
|
+
- **Cost**: generation is free by default — no balance is checked or decremented. To charge users, pass `centsPerImage` in the image properties; the balance gate then applies.
|
|
622
|
+
- **Latency**: the GPU processes one job at a time and the first generation after server start loads the model weights. `COMFYUI_TIMEOUT_MS` (default 10 minutes) covers queue wait plus cold start.
|
|
623
|
+
- **Stories**: to make a pair selectable in the story UI's image-model dropdown, add an entry to `{dataPath}/common/config/image_models.json` with `"service": "ComfyUI"` and the pair name as `"model"` in the `generation` and `editing` blocks, with `"centsPerImage": 0`.
|
|
624
|
+
|
|
625
|
+
**Custom workflows.** Any ComfyUI workflow can be used: build it in the ComfyUI web UI, run it once, then use Export (API format) and replace the values you want parameterized with tokens — `{{prompt}}` (may be embedded in a longer string), `{{seed}}`, `{{width}}`, `{{height}}` (replaced as numbers), and `{{ref_image}}` (edit workflows, the `LoadImage` input). Save the files as `{name}.t2i.json` (used by `generateImage`) and `{name}.edit.json` (used by `editImage`) in `{dataPath}/common/config/comfyui-workflows/`, or in `{dataPath}/user/{userId}/comfyui-workflows/` for a per-user override (checked first). The pair name becomes the model name. For multi-reference support, an edit workflow must contain exactly one `ReferenceLatent` node fed by a `VAEEncode` fed by a `LoadImage`; extra references are added at request time by cloning that chain.
|
|
626
|
+
|
|
562
627
|
## Data Storage
|
|
563
628
|
|
|
564
629
|
Briyah stores data in the following structure:
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"1": {
|
|
3
|
+
"class_type": "UNETLoader",
|
|
4
|
+
"inputs": {
|
|
5
|
+
"unet_name": "flux1-dev-kontext_fp8_scaled.safetensors",
|
|
6
|
+
"weight_dtype": "default"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"2": {
|
|
10
|
+
"class_type": "DualCLIPLoader",
|
|
11
|
+
"inputs": {
|
|
12
|
+
"clip_name1": "clip_l.safetensors",
|
|
13
|
+
"clip_name2": "t5xxl_fp8_e4m3fn_scaled.safetensors",
|
|
14
|
+
"type": "flux"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"3": {
|
|
18
|
+
"class_type": "VAELoader",
|
|
19
|
+
"inputs": {
|
|
20
|
+
"vae_name": "ae.safetensors"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"4": {
|
|
24
|
+
"class_type": "LoadImage",
|
|
25
|
+
"inputs": {
|
|
26
|
+
"image": "{{ref_image}}"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"5": {
|
|
30
|
+
"class_type": "FluxKontextImageScale",
|
|
31
|
+
"inputs": {
|
|
32
|
+
"image": ["4", 0]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"6": {
|
|
36
|
+
"class_type": "VAEEncode",
|
|
37
|
+
"inputs": {
|
|
38
|
+
"pixels": ["5", 0],
|
|
39
|
+
"vae": ["3", 0]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"7": {
|
|
43
|
+
"class_type": "CLIPTextEncode",
|
|
44
|
+
"inputs": {
|
|
45
|
+
"text": "{{prompt}}",
|
|
46
|
+
"clip": ["2", 0]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"8": {
|
|
50
|
+
"class_type": "ReferenceLatent",
|
|
51
|
+
"inputs": {
|
|
52
|
+
"conditioning": ["7", 0],
|
|
53
|
+
"latent": ["6", 0]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"9": {
|
|
57
|
+
"class_type": "FluxGuidance",
|
|
58
|
+
"inputs": {
|
|
59
|
+
"conditioning": ["8", 0],
|
|
60
|
+
"guidance": 2.5
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"10": {
|
|
64
|
+
"class_type": "ConditioningZeroOut",
|
|
65
|
+
"inputs": {
|
|
66
|
+
"conditioning": ["7", 0]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"11": {
|
|
70
|
+
"class_type": "KSampler",
|
|
71
|
+
"inputs": {
|
|
72
|
+
"model": ["1", 0],
|
|
73
|
+
"positive": ["9", 0],
|
|
74
|
+
"negative": ["10", 0],
|
|
75
|
+
"latent_image": ["6", 0],
|
|
76
|
+
"seed": "{{seed}}",
|
|
77
|
+
"steps": 20,
|
|
78
|
+
"cfg": 1.0,
|
|
79
|
+
"sampler_name": "euler",
|
|
80
|
+
"scheduler": "simple",
|
|
81
|
+
"denoise": 1.0
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"12": {
|
|
85
|
+
"class_type": "VAEDecode",
|
|
86
|
+
"inputs": {
|
|
87
|
+
"samples": ["11", 0],
|
|
88
|
+
"vae": ["3", 0]
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"13": {
|
|
92
|
+
"class_type": "SaveImage",
|
|
93
|
+
"inputs": {
|
|
94
|
+
"images": ["12", 0],
|
|
95
|
+
"filename_prefix": "briyah"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"1": {
|
|
3
|
+
"class_type": "UNETLoader",
|
|
4
|
+
"inputs": {
|
|
5
|
+
"unet_name": "flux1-dev-kontext_fp8_scaled.safetensors",
|
|
6
|
+
"weight_dtype": "default"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"2": {
|
|
10
|
+
"class_type": "DualCLIPLoader",
|
|
11
|
+
"inputs": {
|
|
12
|
+
"clip_name1": "clip_l.safetensors",
|
|
13
|
+
"clip_name2": "t5xxl_fp8_e4m3fn_scaled.safetensors",
|
|
14
|
+
"type": "flux"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"3": {
|
|
18
|
+
"class_type": "VAELoader",
|
|
19
|
+
"inputs": {
|
|
20
|
+
"vae_name": "ae.safetensors"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"4": {
|
|
24
|
+
"class_type": "CLIPTextEncode",
|
|
25
|
+
"inputs": {
|
|
26
|
+
"text": "{{prompt}}",
|
|
27
|
+
"clip": ["2", 0]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"5": {
|
|
31
|
+
"class_type": "FluxGuidance",
|
|
32
|
+
"inputs": {
|
|
33
|
+
"conditioning": ["4", 0],
|
|
34
|
+
"guidance": 2.5
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"6": {
|
|
38
|
+
"class_type": "ConditioningZeroOut",
|
|
39
|
+
"inputs": {
|
|
40
|
+
"conditioning": ["4", 0]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"7": {
|
|
44
|
+
"class_type": "EmptySD3LatentImage",
|
|
45
|
+
"inputs": {
|
|
46
|
+
"width": "{{width}}",
|
|
47
|
+
"height": "{{height}}",
|
|
48
|
+
"batch_size": 1
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"8": {
|
|
52
|
+
"class_type": "KSampler",
|
|
53
|
+
"inputs": {
|
|
54
|
+
"model": ["1", 0],
|
|
55
|
+
"positive": ["5", 0],
|
|
56
|
+
"negative": ["6", 0],
|
|
57
|
+
"latent_image": ["7", 0],
|
|
58
|
+
"seed": "{{seed}}",
|
|
59
|
+
"steps": 20,
|
|
60
|
+
"cfg": 1.0,
|
|
61
|
+
"sampler_name": "euler",
|
|
62
|
+
"scheduler": "simple",
|
|
63
|
+
"denoise": 1.0
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"9": {
|
|
67
|
+
"class_type": "VAEDecode",
|
|
68
|
+
"inputs": {
|
|
69
|
+
"samples": ["8", 0],
|
|
70
|
+
"vae": ["3", 0]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"10": {
|
|
74
|
+
"class_type": "SaveImage",
|
|
75
|
+
"inputs": {
|
|
76
|
+
"images": ["9", 0],
|
|
77
|
+
"filename_prefix": "briyah"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"1": {
|
|
3
|
+
"class_type": "UNETLoader",
|
|
4
|
+
"inputs": {
|
|
5
|
+
"unet_name": "flux2_dev_fp8mixed.safetensors",
|
|
6
|
+
"weight_dtype": "default"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"2": {
|
|
10
|
+
"class_type": "CLIPLoader",
|
|
11
|
+
"inputs": {
|
|
12
|
+
"clip_name": "mistral_3_small_flux2_bf16.safetensors",
|
|
13
|
+
"type": "flux2",
|
|
14
|
+
"device": "default"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"3": {
|
|
18
|
+
"class_type": "VAELoader",
|
|
19
|
+
"inputs": {
|
|
20
|
+
"vae_name": "flux2-vae.safetensors"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"4": {
|
|
24
|
+
"class_type": "CLIPTextEncode",
|
|
25
|
+
"inputs": {
|
|
26
|
+
"text": "{{prompt}}",
|
|
27
|
+
"clip": ["2", 0]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"5": {
|
|
31
|
+
"class_type": "FluxGuidance",
|
|
32
|
+
"inputs": {
|
|
33
|
+
"conditioning": ["4", 0],
|
|
34
|
+
"guidance": 4.0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"6": {
|
|
38
|
+
"class_type": "RandomNoise",
|
|
39
|
+
"inputs": {
|
|
40
|
+
"noise_seed": "{{seed}}"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"7": {
|
|
44
|
+
"class_type": "KSamplerSelect",
|
|
45
|
+
"inputs": {
|
|
46
|
+
"sampler_name": "euler"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"8": {
|
|
50
|
+
"class_type": "Flux2Scheduler",
|
|
51
|
+
"inputs": {
|
|
52
|
+
"steps": 20,
|
|
53
|
+
"width": "{{width}}",
|
|
54
|
+
"height": "{{height}}"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"9": {
|
|
58
|
+
"class_type": "EmptyFlux2LatentImage",
|
|
59
|
+
"inputs": {
|
|
60
|
+
"width": "{{width}}",
|
|
61
|
+
"height": "{{height}}",
|
|
62
|
+
"batch_size": 1
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"10": {
|
|
66
|
+
"class_type": "BasicGuider",
|
|
67
|
+
"inputs": {
|
|
68
|
+
"model": ["1", 0],
|
|
69
|
+
"conditioning": ["17", 0]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"11": {
|
|
73
|
+
"class_type": "SamplerCustomAdvanced",
|
|
74
|
+
"inputs": {
|
|
75
|
+
"noise": ["6", 0],
|
|
76
|
+
"guider": ["10", 0],
|
|
77
|
+
"sampler": ["7", 0],
|
|
78
|
+
"sigmas": ["8", 0],
|
|
79
|
+
"latent_image": ["9", 0]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"12": {
|
|
83
|
+
"class_type": "VAEDecode",
|
|
84
|
+
"inputs": {
|
|
85
|
+
"samples": ["11", 0],
|
|
86
|
+
"vae": ["3", 0]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"13": {
|
|
90
|
+
"class_type": "SaveImage",
|
|
91
|
+
"inputs": {
|
|
92
|
+
"images": ["12", 0],
|
|
93
|
+
"filename_prefix": "briyah"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"14": {
|
|
97
|
+
"class_type": "LoadImage",
|
|
98
|
+
"inputs": {
|
|
99
|
+
"image": "{{ref_image}}"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"15": {
|
|
103
|
+
"class_type": "ImageScaleToTotalPixels",
|
|
104
|
+
"inputs": {
|
|
105
|
+
"image": ["14", 0],
|
|
106
|
+
"upscale_method": "area",
|
|
107
|
+
"megapixels": 1.0,
|
|
108
|
+
"resolution_steps": 1
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"16": {
|
|
112
|
+
"class_type": "VAEEncode",
|
|
113
|
+
"inputs": {
|
|
114
|
+
"pixels": ["15", 0],
|
|
115
|
+
"vae": ["3", 0]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"17": {
|
|
119
|
+
"class_type": "ReferenceLatent",
|
|
120
|
+
"inputs": {
|
|
121
|
+
"conditioning": ["5", 0],
|
|
122
|
+
"latent": ["16", 0]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"1": {
|
|
3
|
+
"class_type": "UNETLoader",
|
|
4
|
+
"inputs": {
|
|
5
|
+
"unet_name": "flux2_dev_fp8mixed.safetensors",
|
|
6
|
+
"weight_dtype": "default"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"2": {
|
|
10
|
+
"class_type": "CLIPLoader",
|
|
11
|
+
"inputs": {
|
|
12
|
+
"clip_name": "mistral_3_small_flux2_bf16.safetensors",
|
|
13
|
+
"type": "flux2",
|
|
14
|
+
"device": "default"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"3": {
|
|
18
|
+
"class_type": "VAELoader",
|
|
19
|
+
"inputs": {
|
|
20
|
+
"vae_name": "flux2-vae.safetensors"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"4": {
|
|
24
|
+
"class_type": "CLIPTextEncode",
|
|
25
|
+
"inputs": {
|
|
26
|
+
"text": "{{prompt}}",
|
|
27
|
+
"clip": ["2", 0]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"5": {
|
|
31
|
+
"class_type": "FluxGuidance",
|
|
32
|
+
"inputs": {
|
|
33
|
+
"conditioning": ["4", 0],
|
|
34
|
+
"guidance": 4.0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"6": {
|
|
38
|
+
"class_type": "RandomNoise",
|
|
39
|
+
"inputs": {
|
|
40
|
+
"noise_seed": "{{seed}}"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"7": {
|
|
44
|
+
"class_type": "KSamplerSelect",
|
|
45
|
+
"inputs": {
|
|
46
|
+
"sampler_name": "euler"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"8": {
|
|
50
|
+
"class_type": "Flux2Scheduler",
|
|
51
|
+
"inputs": {
|
|
52
|
+
"steps": 20,
|
|
53
|
+
"width": "{{width}}",
|
|
54
|
+
"height": "{{height}}"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"9": {
|
|
58
|
+
"class_type": "EmptyFlux2LatentImage",
|
|
59
|
+
"inputs": {
|
|
60
|
+
"width": "{{width}}",
|
|
61
|
+
"height": "{{height}}",
|
|
62
|
+
"batch_size": 1
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"10": {
|
|
66
|
+
"class_type": "BasicGuider",
|
|
67
|
+
"inputs": {
|
|
68
|
+
"model": ["1", 0],
|
|
69
|
+
"conditioning": ["5", 0]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"11": {
|
|
73
|
+
"class_type": "SamplerCustomAdvanced",
|
|
74
|
+
"inputs": {
|
|
75
|
+
"noise": ["6", 0],
|
|
76
|
+
"guider": ["10", 0],
|
|
77
|
+
"sampler": ["7", 0],
|
|
78
|
+
"sigmas": ["8", 0],
|
|
79
|
+
"latent_image": ["9", 0]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"12": {
|
|
83
|
+
"class_type": "VAEDecode",
|
|
84
|
+
"inputs": {
|
|
85
|
+
"samples": ["11", 0],
|
|
86
|
+
"vae": ["3", 0]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"13": {
|
|
90
|
+
"class_type": "SaveImage",
|
|
91
|
+
"inputs": {
|
|
92
|
+
"images": ["12", 0],
|
|
93
|
+
"filename_prefix": "briyah"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|