Skip to content

[RUN-2079] Update caption task type#35

Merged
IanLunn merged 8 commits intomainfrom
feature/RUN-2079/caption-task-type
Nov 11, 2025
Merged

[RUN-2079] Update caption task type#35
IanLunn merged 8 commits intomainfrom
feature/RUN-2079/caption-task-type

Conversation

@IanLunn
Copy link
Contributor

@IanLunn IanLunn commented Oct 17, 2025

  • Update requestImageToText to use caption taskType
  • Add inputs and deliveryMethod to requestImageToText
  • Rename private method getResultUUID to getResultValue from a passed in array of keys. Previously this would search for a UUID but now it is required for caption it will search for a text key instead

Added to support Memories AI:

https://runware.atlassian.net/wiki/spaces/SD/pages/158138380/Memories+AI+Video+Transcription

Test scripts

image caption:

export const legacyCaption = async () => {
  try {
    console.log("running legacyCaption");
    await runware.ensureConnection();

    console.time("generation");
    const start = performance.now();
    const result = await runware.requestImageToText({
      "model": "runware:151@1",
      inputImage: "https://im.runware.dev/image/ws/2/ii/0db4fa71-961a-4b36-b7ac-7a458debba93.jpg",
      "includeCost": true
    });
    console.log("result", result);
  } catch (err) {
    console.log("err", err);
  } finally {
    runware.disconnect();
  }
};

legacyCaption();

video caption:

export const caption = async () => {
  try {
    console.log("running caption");
    await runware.ensureConnection();

    console.time("generation");
    const start = performance.now();
    const result = await runware.caption({
      "model": "memories:1@1",
      "inputs": {
        "video": "https://raw.githubusercontent.com/adilentiq/test-images/refs/heads/main/video/resolution/v1_1920_1088.mp4"
      },
      deliveryMethod: "async",
      "includeCost": true
    });
    console.log("result", result);
  } catch (err) {
    console.log("err", err);
  } finally {
    runware.disconnect();
  }
};

caption();

age caption:

export const ageCaption = async () => {
  try {
    console.log("running ageCaption");
    await runware.ensureConnection();

    console.time("generation");
    const start = performance.now();
    const result = await runware.caption({
      "model": "memories:2@1",
      "inputs": {
        "video": "https://raw.githubusercontent.com/adilentiq/test-images/refs/heads/main/video/resolution/v1_1920_1088.mp4"
      },
      deliveryMethod: "async",
      "includeCost": true
    });
    console.log("result", result);
  } catch (err) {
    console.log("err", err);
  } finally {
    runware.disconnect();
  }
};

ageCaption();

```

 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not including table explaining params -- the info is not available and better to have single source of truth from linked docs

@IanLunn IanLunn force-pushed the feature/RUN-2079/caption-task-type branch from 92046ec to 86bbde8 Compare October 17, 2025 10:26
@IanLunn IanLunn marked this pull request as draft October 17, 2025 10:26
@IanLunn IanLunn force-pushed the feature/RUN-2079/caption-task-type branch from 86bbde8 to 6010c75 Compare November 4, 2025 13:50
@IanLunn IanLunn changed the title [RUN-2079] Add caption task type [RUN-2079] Update caption task type Nov 4, 2025
@IanLunn IanLunn requested a review from YomiCasual November 4, 2025 14:20
@IanLunn IanLunn marked this pull request as ready for review November 4, 2025 14:21
* @param resultKeys - The list of keys to check in order of priority.
* @returns The first string value found for the specified keys, or undefined if none found.
*/
private getResultValue(result: any, resultKeys = ["mediaUUID", "imageUUID", "videoUUID"]): string | undefined {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets resolve this to use status, that won't need additional change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getResultValue has been remved. pollForAsyncResults will now check status === "success"

@IanLunn IanLunn merged commit 9ff5ccf into main Nov 11, 2025
1 check failed
@IanLunn IanLunn deleted the feature/RUN-2079/caption-task-type branch November 11, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants