$ account drawthingsai
This repository contains the public-facing source code for Draw Things, a production-grade AI image and video generation application for macOS/iOS/Linux. The codebase implements a comprehensive suite of diffusion models (Stable Diffusion, FLUX, HiDream, Qwen, MiniMax, etc.), samplers, LoRA training, model conversion, and a gRPC-based distributed inference server. It is written primarily in Swift, using Bazel for builds, and includes extensive use of FlatBuffers for data serialization, SQLite for persistence, and a custom neural network compiler (NNC) for on-device inference. The architecture is modular, with separate libraries for tokenization (CLIP, Tiktoken, SentencePiece), model zoos (downloadable model specifications), image generation pipelines, and cloud authentication. The repository also includes CLI tools (draw-things-cli, gRPCServerCLI, model converters) and server management scripts for deploying GPU-backed inference services with Tailscale, Envoy, and Docker. While the core application is a consumer-facing app, the codebase also contains research-grade components such as instruction count estimators for performance profiling, formal verification tools (Z3, Lean), and web search integration with browser fallback. The code is well-structured with many reusable patterns, though it carries some maintenance overhead from vendored dependencies and generated code.