@rslsp1/fa-app-tools 1.3.3 → 1.3.4

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/dist/index.d.mts CHANGED
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
448
448
  declare function autoLabel(index: number): string;
449
449
  declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
450
450
 
451
- declare const LIB_VERSION = "1.3.3";
451
+ declare const LIB_VERSION = "1.3.4";
452
452
 
453
453
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
package/dist/index.d.ts CHANGED
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
448
448
  declare function autoLabel(index: number): string;
449
449
  declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
450
450
 
451
- declare const LIB_VERSION = "1.3.3";
451
+ declare const LIB_VERSION = "1.3.4";
452
452
 
453
453
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
package/dist/index.js CHANGED
@@ -2223,6 +2223,13 @@ function autoLabel(index) {
2223
2223
  function buildReferenceImageMediaIds(images) {
2224
2224
  return images.filter((i) => i.sendToImageGen && i.frame.mediaId).map((i) => i.frame.mediaId);
2225
2225
  }
2226
+ function toPromptImages(images) {
2227
+ return images.filter((i) => i.sendToPromptAI && i.frame.base64).map((i) => {
2228
+ const raw = i.frame.base64.includes(",") ? i.frame.base64.split(",")[1] : i.frame.base64;
2229
+ const mimeType = i.frame.base64.startsWith("data:image/png") ? "image/png" : "image/jpeg";
2230
+ return { base64: raw, mimeType };
2231
+ });
2232
+ }
2226
2233
 
2227
2234
  // src/components/labs/LabsTab.tsx
2228
2235
  var import_react19 = require("react");
@@ -2373,7 +2380,8 @@ var LabRemix = ({ services, onResult }) => {
2373
2380
  instruction,
2374
2381
  selected.item.prompt
2375
2382
  );
2376
- const images = selected.sendToPromptAI ? [{ base64: selected.frame.base64, mimeType: "image/png" }] : void 0;
2383
+ const imgs = toPromptImages([selected]);
2384
+ const images = imgs.length ? imgs : void 0;
2377
2385
  const result = await services.generateText(text, { systemInstruction, images });
2378
2386
  setGeneratedPrompt(result);
2379
2387
  } finally {
@@ -2766,7 +2774,7 @@ var LabCompare = ({ services, onResult }) => {
2766
2774
  setIsAnalyzing(true);
2767
2775
  try {
2768
2776
  const { text, systemInstruction } = buildCompareInstruction(filled, instruction);
2769
- const images = filled.filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2777
+ const images = toPromptImages(filled);
2770
2778
  const result = await services.generateText(text, { systemInstruction, images: images.length ? images : void 0 });
2771
2779
  setAnalysis(result);
2772
2780
  setGeneratedPrompt("");
@@ -2934,7 +2942,7 @@ var LabLoop = ({ services, onResult }) => {
2934
2942
  images: r.images
2935
2943
  }));
2936
2944
  const { text, systemInstruction } = buildLoopInstruction(historyForBuilder, currentInstruction);
2937
- const allImages = [...rounds.flatMap((r) => r.images), ...pendingImages].filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2945
+ const allImages = toPromptImages([...rounds.flatMap((r) => r.images), ...pendingImages]);
2938
2946
  const newPrompt = await services.generateText(text, {
2939
2947
  systemInstruction,
2940
2948
  images: allImages.length ? allImages : void 0
@@ -3932,6 +3940,8 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3932
3940
  "input",
3933
3941
  {
3934
3942
  type: "password",
3943
+ autoComplete: "current-password",
3944
+ id: "hf-token-input",
3935
3945
  value: hfTokenInput,
3936
3946
  onChange: (e) => setHfTokenInput(e.target.value),
3937
3947
  onKeyDown: (e) => {
@@ -4618,7 +4628,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4618
4628
  }
4619
4629
 
4620
4630
  // src/index.ts
4621
- var LIB_VERSION = "1.3.3";
4631
+ var LIB_VERSION = "1.3.4";
4622
4632
  // Annotate the CommonJS export names for ESM import in node:
4623
4633
  0 && (module.exports = {
4624
4634
  AvatarArchitectApp,
package/dist/index.mjs CHANGED
@@ -1760,6 +1760,13 @@ function autoLabel(index) {
1760
1760
  function buildReferenceImageMediaIds(images) {
1761
1761
  return images.filter((i) => i.sendToImageGen && i.frame.mediaId).map((i) => i.frame.mediaId);
1762
1762
  }
1763
+ function toPromptImages(images) {
1764
+ return images.filter((i) => i.sendToPromptAI && i.frame.base64).map((i) => {
1765
+ const raw = i.frame.base64.includes(",") ? i.frame.base64.split(",")[1] : i.frame.base64;
1766
+ const mimeType = i.frame.base64.startsWith("data:image/png") ? "image/png" : "image/jpeg";
1767
+ return { base64: raw, mimeType };
1768
+ });
1769
+ }
1763
1770
 
1764
1771
  // src/components/labs/LabsTab.tsx
1765
1772
  import { useState as useState12 } from "react";
@@ -1910,7 +1917,8 @@ var LabRemix = ({ services, onResult }) => {
1910
1917
  instruction,
1911
1918
  selected.item.prompt
1912
1919
  );
1913
- const images = selected.sendToPromptAI ? [{ base64: selected.frame.base64, mimeType: "image/png" }] : void 0;
1920
+ const imgs = toPromptImages([selected]);
1921
+ const images = imgs.length ? imgs : void 0;
1914
1922
  const result = await services.generateText(text, { systemInstruction, images });
1915
1923
  setGeneratedPrompt(result);
1916
1924
  } finally {
@@ -2303,7 +2311,7 @@ var LabCompare = ({ services, onResult }) => {
2303
2311
  setIsAnalyzing(true);
2304
2312
  try {
2305
2313
  const { text, systemInstruction } = buildCompareInstruction(filled, instruction);
2306
- const images = filled.filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2314
+ const images = toPromptImages(filled);
2307
2315
  const result = await services.generateText(text, { systemInstruction, images: images.length ? images : void 0 });
2308
2316
  setAnalysis(result);
2309
2317
  setGeneratedPrompt("");
@@ -2471,7 +2479,7 @@ var LabLoop = ({ services, onResult }) => {
2471
2479
  images: r.images
2472
2480
  }));
2473
2481
  const { text, systemInstruction } = buildLoopInstruction(historyForBuilder, currentInstruction);
2474
- const allImages = [...rounds.flatMap((r) => r.images), ...pendingImages].filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2482
+ const allImages = toPromptImages([...rounds.flatMap((r) => r.images), ...pendingImages]);
2475
2483
  const newPrompt = await services.generateText(text, {
2476
2484
  systemInstruction,
2477
2485
  images: allImages.length ? allImages : void 0
@@ -3469,6 +3477,8 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3469
3477
  "input",
3470
3478
  {
3471
3479
  type: "password",
3480
+ autoComplete: "current-password",
3481
+ id: "hf-token-input",
3472
3482
  value: hfTokenInput,
3473
3483
  onChange: (e) => setHfTokenInput(e.target.value),
3474
3484
  onKeyDown: (e) => {
@@ -4155,7 +4165,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4155
4165
  }
4156
4166
 
4157
4167
  // src/index.ts
4158
- var LIB_VERSION = "1.3.3";
4168
+ var LIB_VERSION = "1.3.4";
4159
4169
  export {
4160
4170
  AvatarArchitectApp,
4161
4171
  CollapsibleCard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslsp1/fa-app-tools",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Shared tools and hooks for Fine Art flow apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",