UNPKG

n8n-nodes-piapi

Version:

Community n8n nodes for PiAPI - integrate generative AI capabilities (image, video, audio, 3D) into your workflows

402 lines (401 loc) 9.72 kB
import { IDataObject } from 'n8n-workflow'; export interface PiApiCredentials { apiKey: string; } export interface FluxTaskResponse { code: number; message: string; data: { task_id: string; model: string; task_type: string; status: string; input: IDataObject; output: IDataObject | null; meta: { created_at: string; started_at: string; ended_at: string; usage?: { type: string; frozen: number; consume: number; }; is_using_private_pool?: boolean; }; detail: null; logs: IDataObject[]; error: { code: number; raw_message: string; message: string; detail: null; }; }; } export interface KlingTextToVideoParams { prompt: string; negative_prompt?: string; duration: number; aspect_ratio: string; mode: string; version: string; cfg_scale: number; } export interface KlingImageToVideoParams extends KlingTextToVideoParams { image_url?: string; image_tail_url?: string; elements?: Array<{ image_url: string; }>; } export interface KlingLipSyncParams { origin_task_id: string; tts_text?: string; tts_timbre?: string; tts_speed?: number; local_dubbing_url?: string; tts_emotion?: string; } export interface KlingEffectsParams { image_url: string; effect: string; } export interface KlingTryOnParams { model_input: string; dress_input?: string; upper_input?: string; lower_input?: string; batch_size?: number; } export interface HailuoBaseParams { prompt?: string; expand_prompt?: boolean; model: string; } export interface HailuoTextToVideoParams extends HailuoBaseParams { prompt: string; image_url?: never; } export interface HailuoImageToVideoParams extends HailuoBaseParams { image_url: string; prompt?: string; } export interface HailuoSubjectVideoParams extends HailuoBaseParams { prompt: string; image_url: string; } export interface SkyreelsImageToVideoParams { model: string; task_type: string; input: { prompt: string; negative_prompt?: string; image: string; aspect_ratio?: string; guidance_scale?: number; }; } export interface Trellis3DModelParams { image: string; seed?: number; ss_sampling_steps?: number; slat_sampling_steps?: number; ss_guidance_strength?: number; slat_guidance_strength?: number; } export interface FaceswapImageInput { target_image: string; swap_image: string; swap_faces_index?: string; target_faces_index?: string; } export interface FaceswapImageParams { model: string; task_type: string; input: FaceswapImageInput; config?: { webhook_config?: { endpoint?: string; secret?: string; }; service_mode?: string; }; } export interface FaceswapVideoInput { swap_image: string; target_video: string; swap_faces_index?: string; target_faces_index?: string; } export interface FaceswapVideoParams { model: string; task_type: string; input: FaceswapVideoInput; config?: { webhook_config?: { endpoint?: string; secret?: string; }; service_mode?: string; }; } export interface MMAudioVideoToAudioParams { model: string; task_type: string; input: { prompt: string; negative_prompt?: string; video: string; steps?: number; seed?: number; }; config: { webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface DiffRhythmAudioParams { model: string; task_type: string; input: { lyrics?: string; style_prompt?: string; style_audio?: string; }; config: { webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface TTSParams { model: string; task_type: string; input: { gen_text: string; ref_audio: string; ref_text?: string; }; config: { service_mode: string; webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface MidjourneyImagineParams { model: string; task_type: string; input: { prompt: string; aspect_ratio?: string; process_mode?: string; skip_prompt_check?: boolean; }; config?: { webhook_config?: { endpoint?: string; secret?: string; }; service_mode?: string; }; } export interface MidjourneyUpscaleParams { model: string; task_type: string; input: { origin_task_id: string; index: string; }; config?: { webhook_config?: { endpoint?: string; secret?: string; }; service_mode?: string; }; } export interface MidjourneyDescribeParams { model: string; task_type: string; input: { image_url: string; process_mode?: string; bot_id?: number; }; config?: { webhook_config?: { endpoint?: string; secret?: string; }; service_mode?: string; }; } export interface VideoUpscaleParams { model: string; task_type: string; input: { video: string; }; config?: { webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface ImageUpscaleParams { model: string; task_type: string; input: { image: string; scale?: number; }; config?: { webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface RemoveBackgroundParams { model: string; task_type: string; input: { image: string; }; config?: { webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface QubicoSegmentParams { model: string; task_type: string; input: { image: string; prompt: string; negative_prompt: string; segment_factor: number; }; } export interface FileUploadParams { file_name: string; file_data: string; } export interface UdioGenerateMusicParams { model: string; task_type: string; input: { gpt_description_prompt?: string; lyrics?: string; negative_tags?: string; lyrics_type: 'generate' | 'user' | 'instrumental'; seed?: number; continue_song_id?: string; continue_at?: number; }; config: { service_mode?: string; webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface UdioGenerateLyricsParams { model: string; task_type: string; input: { prompt: string; }; config: { service_mode?: string; webhook_config?: { endpoint?: string; secret?: string; }; }; } export interface UdioTaskResponse { code: number; data: { task_id: string; model: string; task_type: string; status: string; input: IDataObject; output: { clips?: { [key: string]: { id?: string; video_url?: string; audio_url?: string; image_url?: string; image_large_url?: string; is_video_pending?: boolean; major_model_version?: string; model_name?: string; metadata?: { tags?: string; prompt?: string; gpt_description_prompt?: string; audio_prompt_id?: string; history?: any; concat_history?: any; type?: string; duration?: number; refund_credits?: boolean; stream?: boolean; error_type?: string; error_message?: string; }; is_liked?: boolean; user_id?: string; display_name?: string; handle?: string; is_handle_updated?: boolean; is_trashed?: boolean; reaction?: any; created_at?: string; status?: string; title?: string; play_count?: number; upvote_count?: number; is_public?: boolean; }; }; lyrics_pairs?: Array<{ title: string; text: string; }>; }; meta: { created_at?: string; started_at?: string; ended_at?: string; usage?: { type: string; frozen: number; consume: number; }; is_using_private_pool?: boolean; }; detail: any; logs: any[]; error: { code: number; raw_message?: string; message: string; detail?: any; }; }; message: string; }