A minimum client for Draw Things API
TinyDTClient is a tiny MacOS SwiftUI Application demonstrating the basic functions for a client to the awesome Image generation app, Draw Things (DT). It is extracted from the full-featured client, PromptWriter.
Dependancy: TinyDTClient depends on the library RealHTTP for the low level http client stuff. Thanks to Immobillaire
The app attempts to connect to a DT server at its default address, and has no UI for configuring server info, so DT must be running on the same mac, with HTTP server on, at port 7860.
The app makes image requests on the API, sending json with 3 parameters:
{"prompt":"your prompt
","negative_prompt":"", "seed":-1}
(prompt from the prompt field, blank negative prompt, random seed)
All other image settings are done directly in DT. There's no error handling or user feedback.
To experiment with building a stable diffusion front end, start by adding to the UI here - such as a text field for negative prompt, or controls for # of steps, etc.
![Screenshot 2024-01-19 at 12 58 42 PM](https://private-user-images.githubusercontent.com/156350598/298156090-dbd609e6-af97-4e3e-8f54-c3a002ec0c07.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxODI2MDYsIm5iZiI6MTcyNDE4MjMwNiwicGF0aCI6Ii8xNTYzNTA1OTgvMjk4MTU2MDkwLWRiZDYwOWU2LWFmOTctNGUzZS04ZjU0LWMzYTAwMmVjMGMwNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMFQxOTMxNDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZTRkMDkyNGQ1ZmY4MDE2MzYwZDdmMzQwMmZlMWRmNzg4ODZhZGM2ZGZiNTlhNTZmZGM4ODk1NjYwMjAxZWZhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.a6ZcXCIKadRePiRwYErk8W-6hEpP8scSsb56CnXblrc)
TinyDTClient running alongside Draw Things