stability-ai
Version:
Node SDK for Stability AI REST API
131 lines (130 loc) • 4.1 kB
TypeScript
import { OutputFormat, StabilityAIContentResponse } from '../../util';
import StabilityAI from '../..';
export type EraseRequest = [
image: string,
options?: {
mask?: string;
seed?: number;
outputFormat?: OutputFormat;
}
];
/**
* Stability AI Stable Image Erase (v2beta)
*
* @param image - Local filepath or public URL of the image to perform erase on
* @param options - Erase Options
*/
export declare function erase(this: StabilityAI, ...args: EraseRequest): Promise<StabilityAIContentResponse>;
export type InpaintRequest = [
image: string,
prompt: string,
options?: {
mask?: string;
negativePrompt?: string;
seed?: number;
outputFormat?: OutputFormat;
}
];
/**
* Stability AI Stable Image Inpaint (v2beta)
*
* @param image - Local filepath or public URL of the image to inpaint
* @param prompt - Prompt to use for inpainting
* @param options - Inpaint Options
*/
export declare function inpaint(this: StabilityAI, ...args: InpaintRequest): Promise<StabilityAIContentResponse>;
export type OutpaintRequest = [
image: string,
options: {
prompt?: string;
seed?: number;
outputFormat?: OutputFormat;
} & ({
left: number;
right?: number;
up?: number;
down?: number;
} | {
left?: number;
right: number;
up?: number;
down?: number;
} | {
left?: number;
right?: number;
up: number;
down?: number;
} | {
left?: number;
right?: number;
up?: number;
down: number;
})
];
/**
* Stability AI Stable Image Outpaint (v2beta)
*
* @param image - Local filepath or public URL of the image to outpaint
* @param prompt - Prompt to use for outpainting
* @param options - Outpaint Options
*/
export declare function outpaint(this: StabilityAI, ...args: OutpaintRequest): Promise<StabilityAIContentResponse>;
export type SearchAndReplaceRequest = [
image: string,
prompt: string,
searchPrompt: string,
options?: {
negativePrompt?: string;
seed?: number;
outputFormat?: OutputFormat;
}
];
/**
* Stability AI Stable Image Search and Replace (v2beta)
*
* @param image - Local filepath or public URL of the image to search and replace
* @param prompt - Prompt to use for search and replace
* @param searchPrompt - Prompt to search for
* @param options - Search and Replace Options
*/
export declare function searchAndReplace(this: StabilityAI, ...args: SearchAndReplaceRequest): Promise<StabilityAIContentResponse>;
export type RemoveBackgroundRequest = [
image: string,
options?: {
outputFormat?: OutputFormat;
}
];
/**
* Stability AI Stable Image Remove Background (v2beta)
*
* @param image - Local filepath or public URL of the image to remove the background from
* @param options - Remove Background Options
*/
export declare function removeBackground(this: StabilityAI, ...args: RemoveBackgroundRequest): Promise<StabilityAIContentResponse>;
export type ReplaceBackgroundAndRelightRequest = [
image: string,
options?: {
backgroundPrompt?: string;
backgroundReference?: string;
foregroundPrompt?: string;
negativePrompt?: string;
preserveOriginalSubject?: number;
originalBackgroundDepth?: number;
keepOriginalBackground?: boolean;
lightSourceDirection?: 'above' | 'below' | 'left' | 'right';
lightReference?: string;
lightSourceStrength?: number;
seed?: number;
outputFormat?: OutputFormat;
}
];
export type ReplaceBackgroundAndRelightResponse = {
id: string;
};
/**
* Stability AI Stable Image Replace Background and Relight (v2beta)
*
* @param image - Local filepath or public URL of the image containing the subject
* @param options - Replace Background and Relight Options
*/
export declare function replaceBackgroundAndRelight(this: StabilityAI, ...args: ReplaceBackgroundAndRelightRequest): Promise<ReplaceBackgroundAndRelightResponse>;