Add existing to tracked

This commit is contained in:
Jay
2026-08-11 09:53:42 -04:00
parent afe07f3055
commit ffd6e3d73c
8531 changed files with 4396230 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
# Third-party notices for vendored protocol definitions
`imageService.proto` and `config.fbs` in this directory are copied verbatim from
the **Draw Things Community** repository:
- Source: https://github.com/drawthingsai/draw-things-community
- Files: `Libraries/GRPC/Models/Sources/imageService/imageService.proto`,
`Libraries/DataModels/Sources/config.fbs`
- Retrieved: 2026-08-04
- Licence: **GPL-3.0**
These files are redistributed here under GPL-3.0 and remain subject to it.
## Scope
- The vendored files above, and the Python stubs generated from them by
`setup.sh` (`imageService_pb2.py`, `imageService_pb2_grpc.py`), derive from
GPL-3.0 sources. Treat them as GPL-3.0.
- `dt_client.py` and `render_court.py` are an independent client that speaks the
protocol. Draw Things' own guidance permits a separately distributed client
under another licence. If this project is ever redistributed, state that
client's licence explicitly rather than leaving it implied.
- **Card artwork is not affected.** Images produced by running the model are
output, not a derivative of the client or the protocol definitions, and are
not placed under GPL-3.0 by this dependency.
## Model checkpoint
`qwen_image_2512_bf16_i8x.ckpt` is a converted build of Qwen-Image-2512, which
upstream is Apache-2.0 (https://huggingface.co/Qwen/Qwen-Image). Apache-2.0
carries no non-commercial restriction. The conversion to Draw Things' `.ckpt`
format was not done by this project, so record the provenance of the exact
checkpoint before shipping commercially — its server-side SHA-256 is captured in
each render's JSON sidecar.
## Copyright position on the artwork
Per U.S. Copyright Office guidance, purely AI-generated material is not itself
protected by copyright; protection attaches to sufficiently creative human
authorship — modification, arrangement, and human-authored elements.
This is why the project treats every generation as **concept material only** and
builds human-refined vector masters. To preserve that position, keep editable
masters and their revision history as evidence of human authorship.
+187
View File
@@ -0,0 +1,187 @@
enum SamplerType: byte {
DPMPP2MKarras,
EulerA,
DDIM,
PLMS,
DPMPPSDEKarras,
UniPC,
LCM,
EulerASubstep,
DPMPPSDESubstep,
TCD,
EulerATrailing,
DPMPPSDETrailing,
DPMPP2MAYS,
EulerAAYS,
DPMPPSDEAYS,
DPMPP2MTrailing,
DDIMTrailing,
UniPCTrailing,
UniPCAYS,
TCDTrailing,
}
enum SeedMode: byte {
Legacy,
TorchCpuCompatible,
ScaleAlike,
NvidiaGpuCompatible,
}
enum ControlMode: byte {
Balanced,
Prompt,
Control,
}
enum ControlInputType: byte {
Unspecified,
Custom,
Depth,
Canny,
Scribble,
Pose,
Normalbae,
Color,
Lineart,
Softedge,
Seg,
Inpaint,
Ip2p,
Shuffle,
Mlsd,
Tile,
Blur,
Lowquality,
Gray,
}
table Control {
file: string;
weight: float = 1;
guidance_start: float = 0;
guidance_end: float = 1;
no_prompt: bool = false;
global_average_pooling: bool = true;
down_sampling_rate: float = 1;
control_mode: ControlMode = Balanced;
target_blocks: [string];
input_override: ControlInputType = Unspecified;
}
enum LoRAMode: byte {
All,
Base,
Refiner,
}
enum CompressionMethod: byte {
Disabled,
H264,
H265,
Jpeg,
}
enum ColorCalibration: byte {
Disabled,
Lab,
}
table LoRA {
file: string;
weight: float = 0.6;
mode: LoRAMode = All;
}
table GenerationConfiguration {
id: long (primary);
start_width: ushort;
start_height: ushort;
seed: uint;
steps: uint;
guidance_scale: float;
strength: float;
model: string;
sampler: SamplerType = DPMPP2MKarras;
batch_count: uint = 1;
batch_size: uint = 1;
hires_fix: bool = false;
hires_fix_start_width: ushort;
hires_fix_start_height: ushort;
hires_fix_strength: float = 0.7;
upscaler: string;
image_guidance_scale: float = 1.5;
seed_mode: SeedMode = Legacy;
clip_skip: uint = 1;
controls: [Control];
loras: [LoRA];
mask_blur: float;
face_restoration: string;
decode_with_attention: bool = true (deprecated);
hires_fix_decode_with_attention: bool = true (deprecated);
clip_weight: float = 1;
negative_prompt_for_image_prior: bool = true;
image_prior_steps: uint = 5;
refiner_model: string;
original_image_height: uint;
original_image_width: uint;
crop_top: int;
crop_left: int;
target_image_height: uint;
target_image_width: uint;
aesthetic_score: float = 6;
negative_aesthetic_score: float = 2.5;
zero_negative_prompt: bool = false;
refiner_start: float = 0.7;
negative_original_image_height: uint;
negative_original_image_width: uint;
name: string (indexed);
fps_id: uint = 5;
motion_bucket_id: uint = 127;
cond_aug: float = 0.02;
start_frame_cfg: float = 1.0;
num_frames: uint = 14;
mask_blur_outset: int = 0;
sharpness: float = 0;
shift: float = 1.0;
stage_2_steps: uint = 10;
stage_2_cfg: float = 1.0;
stage_2_shift: float = 1.0;
tiled_decoding: bool = false;
decoding_tile_width: ushort = 10;
decoding_tile_height: ushort = 10;
decoding_tile_overlap: ushort = 2;
stochastic_sampling_gamma: float = 0.3;
preserve_original_after_inpaint: bool = true;
tiled_diffusion: bool = false;
diffusion_tile_width: ushort = 16;
diffusion_tile_height: ushort = 16;
diffusion_tile_overlap: ushort = 2;
upscaler_scale_factor: ubyte = 0;
t5_text_encoder: bool = true;
separate_clip_l: bool = false;
clip_l_text: string;
separate_open_clip_g: bool = false;
open_clip_g_text: string;
speed_up_with_guidance_embed: bool = true;
guidance_embed: float = 3.5;
resolution_dependent_shift: bool = true;
tea_cache_start: int = 5;
tea_cache_end: int = -1;
tea_cache_threshold: float = 0.06;
tea_cache: bool = false;
separate_t5: bool = false;
t5_text: string;
tea_cache_max_skip_steps: int = 3;
causal_inference_enabled: bool = false;
causal_inference: int = 3;
causal_inference_pad: int = 0;
cfg_zero_star: bool = false;
cfg_zero_init_steps: int = 0;
compression_artifacts: CompressionMethod = Disabled;
compression_artifacts_quality: float = 43.1;
color_calibration: ColorCalibration = Disabled;
expand_prompt_to_json: bool = false;
}
root_type GenerationConfiguration;
+190
View File
@@ -0,0 +1,190 @@
syntax = "proto3";
service ImageGenerationService {
rpc GenerateImage(ImageGenerationRequest) returns (stream ImageGenerationResponse);
rpc FilesExist(FileListRequest) returns (FileExistenceResponse);
rpc UploadFile(stream FileUploadRequest) returns (stream UploadResponse);
rpc Echo(EchoRequest) returns (EchoReply);
rpc Pubkey(PubkeyRequest) returns (PubkeyResponse);
rpc Hours(HoursRequest) returns (HoursResponse);
}
message EchoRequest {
string name = 1;
optional string sharedSecret = 2; // The secret use to authenticate if needed.
}
message ComputeUnitThreshold {
double community = 1;
double plus = 2;
int64 expireAt = 3;
}
message EchoReply {
string message = 1;
repeated string files = 2;
optional MetadataOverride override = 3;
bool sharedSecretMissing = 4; // If this is true, sharedSecret is required.
optional ComputeUnitThreshold thresholds = 5; // The thresholds currently imposed by the server.
uint64 serverIdentifier = 6; // A 64-bit server identifier for system to distinguish whether this is a remote server or the same server from the app.
}
message FileListRequest {
repeated string files = 1;
repeated string filesWithHash = 2;
optional string sharedSecret = 3; // The secret use to authenticate if needed.
}
message FileExistenceResponse {
repeated string files = 1;
repeated bool existences = 2;
repeated bytes hashes = 3;
}
message MetadataOverride {
bytes models = 1;
bytes loras = 2;
bytes controlNets = 3;
bytes textualInversions = 4;
bytes upscalers = 5;
}
enum DeviceType {
PHONE = 0;
TABLET = 1;
LAPTOP = 2;
}
// parameters in this Request is exactly same as generate function in ImageGenerator
message ImageGenerationRequest {
optional bytes image = 1; // Image data as sha256 content.
int32 scaleFactor = 2;
optional bytes mask = 3; // Optional Mask data as sha256 content.
repeated HintProto hints = 4; // List of hints
string prompt = 5; // Optional prompt string
string negativePrompt = 6; // Optional negative prompt string
bytes configuration = 7; // Configuration data as bytes (FlatBuffer)
MetadataOverride override = 8; // Override the existing metadata on various Zoo objects.
repeated string keywords = 9; // Keywords send to the ImageGenerator, not useful for local generation.
string user = 10; // The name of the client.
DeviceType device = 11; // The type of the device uses.
repeated bytes contents = 12; // The image data as array of bytes. It is addressed by its sha256 content. This is modeled as content-addressable storage.
optional string sharedSecret = 13; // The secret use to authenticate if needed.
bool chunked = 14; // Whether we can accept chunked response.
}
message HintProto {
string hintType = 1; // hintType enum (key)
repeated TensorAndWeight tensors = 2; // Repeated list of tensors with associated float
}
// Message to store each tensor and its associated float score
message TensorAndWeight {
bytes tensor = 1; // Tensor data as sha256 to the content.
float weight = 2; // Associated float score for the tensor
}
message ImageGenerationSignpostProto {
message TextEncoded {
}
message ImageEncoded {
}
message Sampling {
int32 step = 1;
}
message ImageDecoded {
}
message SecondPassImageEncoded {
}
message SecondPassSampling {
int32 step = 1;
}
message SecondPassImageDecoded {
}
message FaceRestored {
}
message ImageUpscaled {
}
oneof signpost {
TextEncoded textEncoded = 1;
ImageEncoded imageEncoded = 2;
Sampling sampling = 3;
ImageDecoded imageDecoded = 4;
SecondPassImageEncoded secondPassImageEncoded = 5;
SecondPassSampling secondPassSampling = 6;
SecondPassImageDecoded secondPassImageDecoded = 7;
FaceRestored faceRestored = 8;
ImageUpscaled imageUpscaled = 9;
}
}
enum ChunkState {
LAST_CHUNK = 0;
MORE_CHUNKS = 1;
}
message RemoteDownloadResponse {
int64 bytesReceived = 1;
int64 bytesExpected = 2;
int32 item = 3;
int32 itemsExpected = 4;
string tag = 5;
}
message ImageGenerationResponse {
repeated bytes generatedImages = 1; // Generated image data as bytes.
optional ImageGenerationSignpostProto currentSignpost = 2; // Single current signpost.
repeated ImageGenerationSignpostProto signposts = 3; // Collection of signposts.
optional bytes previewImage = 4; // preview generating image data as bytes.
optional int32 scaleFactor = 5; // The scale factor of the image.
repeated string tags = 6; // Tags to track which server responded to the generation request.
optional int64 downloadSize = 7; // The size of final image will be sent in the next payload.
ChunkState chunkState = 8; // What's this chunk is, it helps to compose the chunks together.
optional RemoteDownloadResponse remoteDownload = 9; // If the remote needs to download something, which are they.
repeated bytes generatedAudio = 10; // Generated audio data as bytes.
}
message FileChunk {
bytes content = 1;
string filename = 2;
int64 offset = 3;
}
message InitUploadRequest {
string filename = 1; // Name of the file to be uploaded.
bytes sha256 = 2; // SHA-256 hash of the file.
int64 totalSize = 3; // Total size of the file in bytes.
}
message UploadResponse {
bool chunkUploadSuccess = 1;
int64 receivedOffset = 2;
string message = 3;
string filename = 4;
}
// Union type for either an InitUploadRequest or FileChunk.
message FileUploadRequest {
oneof request {
InitUploadRequest initRequest = 1; // Initial upload request to sync SHA and filename.
FileChunk chunk = 2; // File chunk data.
}
optional string sharedSecret = 3; // The secret use to authenticate if needed.
}
message PubkeyRequest {
string name = 1;
}
message PubkeyResponse {
string message = 1;
string pubkey = 2;
}
message HoursRequest {
}
message HoursResponse {
ComputeUnitThreshold thresholds = 1; // The thresholds currently imposed by the server.
}