123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- import { HttpClient } from '@angular/common/http';
- import { NovaCloudService } from '../../../nova-cloud/nova-cloud.service';
- import Parse from "parse";
- import { NovaUploadService } from '../../../storage/service-upload/nova-upload.service';
- import { DalleOptions } from './imagine-func';
- import * as i0 from "@angular/core";
- export interface StableDiffusionOptions {
- prompt: string;
- modelStyleId: number;
- negativePrompt?: string;
- width?: number;
- height?: number;
- steps?: number;
- seed?: number;
- cfgScale?: number;
- hrScale?: number;
- hrSteps?: number;
- upscale?: number;
- batchSize?: number;
- faceFix?: boolean;
- detailsLevel?: number;
- img?: string;
- imgOptions?: imgOptions;
- denoisingStrength?: number;
- controlnet?: {
- units?: ControlnetUnits[];
- };
- }
- /**
- * imgOptions 图像配置参数
- * @public
- */
- export interface imgOptions {
- removeBackground?: boolean;
- redrawBackground?: boolean;
- mainObjectType?: "human" | "general";
- facePreservation?: boolean;
- facePreservationCount?: number;
- genderDetect?: boolean;
- }
- /**
- * ControlnetUnits 控制网络单元
- * @public
- */
- export interface ControlnetUnits {
- isOpen?: boolean;
- type?: string;
- preprocess?: boolean;
- image?: string;
- controlMode?: number;
- weight?: number;
- controlStart?: number;
- controlEnd?: number;
- paramsA?: number;
- paramsB?: number;
- controlArray?: any[];
- }
- /**
- * ImagineService AI绘画服务
- */
- export declare class ImagineService {
- private http;
- private ncloud;
- private uploadServ;
- /**
- * 图片生成接口主机地址
- */
- constructor(http: HttpClient, ncloud: NovaCloudService, uploadServ: NovaUploadService);
- /**
- * DALL-E-3 图片生成函数
- * @description
- * @see
- * https://p4.hosteagle.club/docs/api-reference?__cpo=aHR0cHM6Ly9wbGF0Zm9ybS5vcGVuYWkuY29t
- * @returns
- * {
- "id": "lpJGiFwWeA", // 图片生成任务ID
- "createdAt": "2024-11-27T12:18:14.463Z"
- }
- * @param {DalleOptions} options
- * @param {string} options.prompt 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
- * @param {string} options.model dall-e-3 dall-e-2
- * @param {string} options.quality dall-e-3 only hd means more details & consistency
- * @param {string} options.response_format url | b64_json
- * @param {string} options.size 1024x1024, 1792x1024, or 1024x1792 for dall-e-3
- * @param {string} options.style vivid | natural dall-e-3 only
- */
- drawDalle(options: DalleOptions): Promise<Parse.Object<Parse.Attributes>>;
- priceDalle(options: DalleOptions): any;
- priceStableDiffusion(options: StableDiffusionOptions): number;
- b64DataToBase64Image(b64_json: any): void;
- /**
- * Huashi6专用绘图函数
- * @param reqBody
- * @see
- * 接口reqBody参数,参考:https://www.showdoc.com.cn/2307900595645609/10319675987319598
- * 密码:123456
- * @returns
- */
- draw(reqBody: any): Promise<any>;
- /**
- * 已完成的直接加载,未完成的再接口更新
- * @param taskId
- * @returns
- */
- taskDetail(taskId: string): Promise<any>;
- taskDetailMap: any;
- /**
- * 我的绘画作品共享方法
- */
- newWorkList: Array<Parse.Object>;
- myWorkList: Array<Parse.Object>;
- getMyWorkQuery(): Parse.Query<Parse.Object<Parse.Attributes>>;
- getWorkQuery(): Parse.Query<Parse.Object<Parse.Attributes>>;
- getimg(): Promise<string>;
- static ɵfac: i0.ɵɵFactoryDeclaration<ImagineService, never>;
- static ɵprov: i0.ɵɵInjectableDeclaration<ImagineService>;
- }
|