""" Options: Date: 2025-01-08 03:11:51 Version: 8.53 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://blazordiffusion.com #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: CreateCreative.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ import datetime import decimal from marshmallow.fields import * from servicestack import * from typing import * from dataclasses import dataclass, field from dataclasses_json import dataclass_json, LetterCase, Undefined, config from enum import Enum, IntEnum @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Artist(AuditBase): id: int = 0 first_name: Optional[str] = None last_name: Optional[str] = None year_died: Optional[int] = None type: Optional[List[str]] = None score: int = 0 rank: int = 0 # @ValidateRequest(Validator="HasRole(`Moderator`)") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CreativeArtist: id: int = 0 # @References(typeof(Creative)) creative_id: int = 0 # @References(typeof(Artist)) artist_id: int = 0 artist: Optional[Artist] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Modifier(AuditBase): id: int = 0 name: Optional[str] = None category: Optional[str] = None description: Optional[str] = None score: int = 0 rank: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CreativeModifier: id: int = 0 # @References(typeof(Creative)) creative_id: int = 0 # @References(typeof(Modifier)) modifier_id: int = 0 modifier: Optional[Modifier] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Artifact(AuditBase): id: int = 0 # @References(typeof(Creative)) creative_id: int = 0 file_name: Optional[str] = None file_path: Optional[str] = None content_type: Optional[str] = None content_length: int = 0 width: int = 0 height: int = 0 seed: int = 0 prompt: Optional[str] = None nsfw: Optional[bool] = None average_hash: Optional[int] = None perceptual_hash: Optional[int] = None difference_hash: Optional[int] = None background: Optional[str] = None lqip: Optional[str] = None quality: int = 0 likes_count: int = 0 albums_count: int = 0 downloads_count: int = 0 search_count: int = 0 temporal_score: int = 0 score: int = 0 rank: int = 0 ref_id: Optional[str] = None versions: Dict[str, str] = field(default_factory=dict) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Creative(AuditBase): id: int = 0 user_prompt: Optional[str] = None prompt: Optional[str] = None images: int = 0 width: int = 0 height: int = 0 steps: int = 0 curated_artifact_id: Optional[int] = None primary_artifact_id: Optional[int] = None artist_names: List[str] = field(default_factory=list) modifier_names: List[str] = field(default_factory=list) artists: List[CreativeArtist] = field(default_factory=list) modifiers: List[CreativeModifier] = field(default_factory=list) artifacts: List[Artifact] = field(default_factory=list) error: Optional[str] = None owner_id: Optional[int] = None owner_ref: Optional[str] = None key: Optional[str] = None curated: bool = False rating: Optional[int] = None private: bool = False score: int = 0 rank: int = 0 ref_id: Optional[str] = None request_id: Optional[str] = None engine_id: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CreateCreativeResponse: result: Optional[Creative] = None response_status: Optional[ResponseStatus] = None # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CreateCreative(IReturn[CreateCreativeResponse], ICreateDb[Creative]): # @Required() user_prompt: Optional[str] = None images: Optional[int] = None width: Optional[int] = None height: Optional[int] = None steps: Optional[int] = None seed: Optional[int] = None engine_id: Optional[str] = None artist_ids: Optional[List[int]] = None modifier_ids: Optional[List[int]] = None