Hierarchy (View Summary)

  • DataEntity<
        {
            error?: ErrorData;
            id: string;
            isNSFW?: boolean;
            jobIndex?: number;
            negativePrompt?: string;
            positivePrompt?: string;
            previewUrl?: string;
            projectId: string;
            resultUrl?: null
            | string;
            seed?: number;
            status: JobStatus;
            step: number;
            stepCount: number;
            userCanceled?: boolean;
            workerName?: string;
        },
        JobEventMap,
    >
    • Job

Constructors

  • Parameters

    • data: {
          error?: ErrorData;
          id: string;
          isNSFW?: boolean;
          jobIndex?: number;
          negativePrompt?: string;
          positivePrompt?: string;
          previewUrl?: string;
          projectId: string;
          resultUrl?: null | string;
          seed?: number;
          status: JobStatus;
          step: number;
          stepCount: number;
          userCanceled?: boolean;
          workerName?: string;
      }
    • options: JobOptions

    Returns Job

Properties

data: {
    error?: ErrorData;
    id: string;
    isNSFW?: boolean;
    jobIndex?: number;
    negativePrompt?: string;
    positivePrompt?: string;
    previewUrl?: string;
    projectId: string;
    resultUrl?: null | string;
    seed?: number;
    status: JobStatus;
    step: number;
    stepCount: number;
    userCanceled?: boolean;
    workerName?: string;
}
lastUpdated: Date = ...
listeners: {
    completed?: (data: string) => void[];
    failed?: (data: ErrorData) => void[];
    progress?: (data: number) => void[];
    updated?: (data: string[]) => void[];
} = {}

Accessors

  • get enhancedImage(): | null
    | {
        error: undefined
        | ErrorData;
        getResultUrl: () => Promise<string>;
        progress: number;
        result: null | string;
        status: ProjectStatus;
    }
  • Returns
        | null
        | {
            error: undefined
            | ErrorData;
            getResultUrl: () => Promise<string>;
            progress: number;
            result: null | string;
            status: ProjectStatus;
        }

  • get isNSFW(): boolean
  • Whether the image is NSFW or not. Only makes sense if job is completed. If NSFW filter is disabled, this property will always be false. If NSFW filter is enabled and the image is NSFW, image will not be available for download.

    Returns boolean

  • get previewUrl(): undefined | string
  • Last preview image URL generated by the worker.

    Returns undefined | string

  • get progress(): number
  • Progress of the job in percentage (0-100).

    Returns number

  • get resultUrl(): undefined | null | string
  • URL to the result image, could be null if the job was canceled or triggered NSFW filter while it was not disabled explicitly.

    Returns undefined | null | string

  • get seed(): undefined | number
  • Seed used to generate the image. This property is only available when the job is completed.

    Returns undefined | number

  • get stepCount(): number
  • Total number of steps that worker will perform.

    Returns number

  • get workerName(): undefined | string
  • Name of the worker that is processing this job.

    Returns undefined | string

Methods

  • Enhance the image using the Flux model. This method will create a new project with the enhancement parameters and use the result image of the current job as the starting image.

    Parameters

    • strength: EnhancementStrength

      how much freedom the model has to change the image.

    • overrides: { positivePrompt?: string; stylePrompt?: string; tokenType?: TokenType } = {}

      optional parameters to override original prompt, style or token type.

    Returns Promise<string>

  • Get the result URL of the job. This method will make a request to the API to get signed URL. IMPORTANT: URL expires after 30 minutes, so make sure to download the image as soon as possible.

    Returns Promise<string>

  • Get a copy of the entity's data

    Returns {
        error?: ErrorData;
        id: string;
        isNSFW?: boolean;
        jobIndex?: number;
        negativePrompt?: string;
        positivePrompt?: string;
        previewUrl?: string;
        projectId: string;
        resultUrl?: null | string;
        seed?: number;
        status: JobStatus;
        step: number;
        stepCount: number;
        userCanceled?: boolean;
        workerName?: string;
    }