// @DataContract
export class QueryBase
{
// @DataMember(Order=1)
public skip?: number;
// @DataMember(Order=2)
public take?: number;
// @DataMember(Order=3)
public orderBy: string;
// @DataMember(Order=4)
public orderByDesc: string;
// @DataMember(Order=5)
public include: string;
// @DataMember(Order=6)
public fields: string;
// @DataMember(Order=7)
public meta: { [index:string]: string; };
public constructor(init?: Partial<QueryBase>) { (Object as any).assign(this, init); }
}
export class QueryDb<T> extends QueryBase
{
public constructor(init?: Partial<QueryDb<T>>) { super(init); (Object as any).assign(this, init); }
}
export enum ComfySampler
{
euler = 'euler',
euler_cfg_pp = 'euler_cfg_pp',
euler_ancestral = 'euler_ancestral',
euler_ancestral_cfg_pp = 'euler_ancestral_cfg_pp',
huen = 'huen',
huenpp2 = 'huenpp2',
dpm_2 = 'dpm_2',
dpm_2_ancestral = 'dpm_2_ancestral',
lms = 'lms',
dpm_fast = 'dpm_fast',
dpm_adaptive = 'dpm_adaptive',
dpmpp_2s_ancestral = 'dpmpp_2s_ancestral',
dpmpp_sde = 'dpmpp_sde',
dpmpp_sde_gpu = 'dpmpp_sde_gpu',
dpmpp_2m = 'dpmpp_2m',
dpmpp_2m_sde = 'dpmpp_2m_sde',
dpmpp_2m_sde_gpu = 'dpmpp_2m_sde_gpu',
dpmpp_3m_sde = 'dpmpp_3m_sde',
dpmpp_3m_sde_gpu = 'dpmpp_3m_sde_gpu',
ddpm = 'ddpm',
lcm = 'lcm',
ddim = 'ddim',
uni_pc = 'uni_pc',
uni_pc_bh2 = 'uni_pc_bh2',
}
export enum ModelType
{
TextToImage = 'TextToImage',
TextEncoder = 'TextEncoder',
ImageUpscale = 'ImageUpscale',
TextToSpeech = 'TextToSpeech',
TextToAudio = 'TextToAudio',
SpeechToText = 'SpeechToText',
ImageToText = 'ImageToText',
ImageToImage = 'ImageToImage',
ImageWithMask = 'ImageWithMask',
VAE = 'VAE',
}
export class ProviderModelDefaults
{
public id: string;
public apiModels: { [index:string]: string; } = {};
public url: string;
public quality?: number;
public aspectRatio: string;
public cfgScale?: number;
public scheduler: string;
public sampler?: ComfySampler;
public width?: number;
public height?: number;
public steps?: number;
public negativePrompt: string;
public modelType?: ModelType;
public constructor(init?: Partial<ProviderModelDefaults>) { (Object as any).assign(this, init); }
}
export class QueryGenerationModelSettings extends QueryDb<ProviderModelDefaults>
{
public id: string;
public constructor(init?: Partial<QueryGenerationModelSettings>) { super(init); (Object as any).assign(this, init); }
}
// @DataContract
export class AuditBase
{
// @DataMember(Order=1)
public createdDate: string;
// @DataMember(Order=2)
// @Required()
public createdBy: string;
// @DataMember(Order=3)
public modifiedDate: string;
// @DataMember(Order=4)
// @Required()
public modifiedBy: string;
// @DataMember(Order=5)
public deletedDate?: string;
// @DataMember(Order=6)
public deletedBy: string;
public constructor(init?: Partial<AuditBase>) { (Object as any).assign(this, init); }
}
export class Artifact extends AuditBase
{
public id: number;
// @References("typeof(BlazorDiffusion.ServiceModel.Creative)")
public creativeId: number;
public fileName: string;
public filePath: string;
public contentType: string;
public contentLength: number;
public width: number;
public height: number;
public seed: number;
public prompt: string;
public nsfw?: boolean;
public averageHash?: number;
public perceptualHash?: number;
public differenceHash?: number;
public background?: string;
public lqip?: string;
public quality: number;
public likesCount: number;
public albumsCount: number;
public downloadsCount: number;
public searchCount: number;
public temporalScore: number;
public score: number;
public rank: number;
public refId: string;
public versions: { [index:string]: string; } = {};
public constructor(init?: Partial<Artifact>) { super(init); (Object as any).assign(this, init); }
}
export class ArtifactResult extends Artifact
{
public userPrompt: string;
public artistNames: string[] = [];
public modifierNames: string[] = [];
public primaryArtifactId?: number;
public ownerRef: string;
public similarity?: number;
public constructor(init?: Partial<ArtifactResult>) { super(init); (Object as any).assign(this, init); }
}
// @DataContract
export class QueryResponse<T>
{
// @DataMember(Order=1)
public offset: number;
// @DataMember(Order=2)
public total: number;
// @DataMember(Order=3)
public results: ArtifactResult[];
// @DataMember(Order=4)
public meta: { [index:string]: string; };
// @DataMember(Order=5)
public responseStatus: ResponseStatus;
public constructor(init?: Partial<QueryResponse<T>>) { (Object as any).assign(this, init); }
}
TypeScript QueryGenerationModelSettings DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/QueryGenerationModelSettings HTTP/1.1
Host: blazordiffusion.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<QueryGenerationModelSettings xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AiServer.ServiceModel">
<Skip xmlns="http://schemas.servicestack.net/types">0</Skip>
<Take xmlns="http://schemas.servicestack.net/types">0</Take>
<OrderBy xmlns="http://schemas.servicestack.net/types">String</OrderBy>
<OrderByDesc xmlns="http://schemas.servicestack.net/types">String</OrderByDesc>
<Include xmlns="http://schemas.servicestack.net/types">String</Include>
<Fields xmlns="http://schemas.servicestack.net/types">String</Fields>
<Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.servicestack.net/types">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Meta>
<Id>String</Id>
</QueryGenerationModelSettings>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <QueryResponseOfProviderModelDefaultsHzAs4VeO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Offset>0</Offset> <Total>0</Total> <Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/AiServer.ServiceModel.Types"> <d2p1:ProviderModelDefaults> <d2p1:ApiModels xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringstring> <d4p1:Key>String</d4p1:Key> <d4p1:Value>String</d4p1:Value> </d4p1:KeyValueOfstringstring> </d2p1:ApiModels> <d2p1:AspectRatio>String</d2p1:AspectRatio> <d2p1:CfgScale>0</d2p1:CfgScale> <d2p1:Height>0</d2p1:Height> <d2p1:Id>String</d2p1:Id> <d2p1:ModelType>TextToImage</d2p1:ModelType> <d2p1:NegativePrompt>String</d2p1:NegativePrompt> <d2p1:Quality>0</d2p1:Quality> <d2p1:Sampler>euler</d2p1:Sampler> <d2p1:Scheduler>String</d2p1:Scheduler> <d2p1:Steps>0</d2p1:Steps> <d2p1:Url>String</d2p1:Url> <d2p1:Width>0</d2p1:Width> </d2p1:ProviderModelDefaults> </Results> <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfstringstring> <d2p1:Key>String</d2p1:Key> <d2p1:Value>String</d2p1:Value> </d2p1:KeyValueOfstringstring> </Meta> <ResponseStatus> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </Meta> </ResponseStatus> </QueryResponseOfProviderModelDefaultsHzAs4VeO>