{"id":30385316,"url":"https://github.com/funkatron/dts-utils","last_synced_at":"2025-08-21T02:13:50.836Z","repository":{"id":282994397,"uuid":"949737059","full_name":"funkatron/dts-utils","owner":"funkatron","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-09T18:48:51.000Z","size":110,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T12:34:14.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funkatron.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-17T03:54:01.000Z","updated_at":"2025-07-12T18:13:17.000Z","dependencies_parsed_at":"2025-07-08T02:43:38.959Z","dependency_job_id":"747d299f-5a12-4775-8b50-d427c18eab89","html_url":"https://github.com/funkatron/dts-utils","commit_stats":null,"previous_names":["funkatron/draw-things-grpcservercli-installer","funkatron/dts-utils"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/funkatron/dts-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fdts-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fdts-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fdts-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fdts-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkatron","download_url":"https://codeload.github.com/funkatron/dts-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkatron%2Fdts-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271415496,"owners_count":24755639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-21T02:13:49.842Z","updated_at":"2025-08-21T02:13:50.832Z","avatar_url":"https://github.com/funkatron.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Draw Things gRPC Server Utilities\n\nA Python package providing utilities for interacting with the Draw Things gRPC server. This package includes tools for server installation, management, and client communication.\n\n## What This Package Provides\n\n- **Server Management Tools**:\n  - Installation and configuration of the Draw Things gRPC server\n  - Server lifecycle management (start, stop, restart)\n  - Health monitoring and status checks\n  - Log file management\n\n- **Client Utilities**:\n  - Python helper functions for connecting to the gRPC server\n  - Error handling utilities for gRPC calls\n  - Connection management tools\n\n- **Security Features**:\n  - TLS configuration management\n  - Authentication setup\n  - Certificate management\n\n### What This Package Does _Not_ Provide\n\n- **Image Generation Logic**: The actual image generation is handled by the Draw Things gRPC server\n- **Model Management**: Model loading and management is handled by the server\n- **GPU Management**: GPU configuration is handled by the server\n- **Web Interface**: This is a command-line and programmatic interface only\n- **Endpoint Management**: The gRPC server's endpoints are fixed and cannot be modified through this tool\n\n## Features\n\n- **Server Management**: One-command installation and configuration of the Draw Things gRPC server\n- **gRPC Client Utilities**: Python library for easy integration with the image generation service\n- **File Management**: Tools for handling server files and configurations\n- **Health Monitoring**: Built-in health check endpoints for server status verification\n- **Security Features**:\n  - TLS encryption support for secure communication\n  - Authentication via shared secrets\n  - Certificate chain verification\n  - Client certificate validation\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/funkatron/draw-things-grpcservercli-installer.git\ncd draw-things-grpcservercli-installer\n\n# Create and activate a virtual environment\npython -m venv venv\nsource venv/bin/activate  # On macOS/Linux\n# or\n.\\venv\\Scripts\\activate  # On Windows\n\n# Install the package\npip install .\n```\n\nNote: Always activate the virtual environment before using dts-util commands:\n```bash\nsource venv/bin/activate  # On macOS/Linux\n# or\n.\\venv\\Scripts\\activate  # On Windows\n```\n\n## Getting Started\n\n### Quick Start Guide\n\nIf you're new to the Draw Things gRPC server, here's a simple guide to get you started:\n\n1. **Install the Server**:\n```bash\n# This will install the server with default settings\ndts-util install\n```\n\n2. **Verify the Server is Running**:\n```bash\ndts-util test\n```\n\n3. **Generate Your First Image**:\n```python\nfrom dts_util.grpc.utils import create_channel_and_stub, handle_grpc_error\nfrom dts_util.grpc.proto.image_generation_pb2 import GenerateImageRequest\n\n# Connect to the server (defaults to localhost:7859, no TLS)\nchannel, stub = create_channel_and_stub(port=7859)\n\n# Generate an image\nwith handle_grpc_error():\n    response = stub.GenerateImage(GenerateImageRequest(\n        prompt=\"a beautiful sunset over mountains\",  # Describe what you want to generate\n        negative_prompt=\"\",                          # What you don't want in the image\n        width=512,                                   # Image width in pixels\n        height=512                                   # Image height in pixels\n    ))\n```\n\n### Common Tasks\n\n#### Custom Server Settings\n\n```bash\n# Change port and model path\ndts-util install --port 7860 --model-path /path/to/model\n\n# Enable advanced features\ndts-util install --model-browser --debug\n```\n\n#### Secure Setup\n\n```bash\n# Enable TLS and set a shared secret\ndts-util install --shared-secret \"your-secret-here\"\n```\n\n#### Server Management\n\n```bash\n# Check server status\ndts-util test\n\n# Restart the server\ndts-util restart\n\n# Uninstall the server\ndts-util uninstall\n```\n\n## Troubleshooting\n\n### Server Not Starting\n\n1. Check server status:\n```bash\ndts-util test\n```\n\n2. Check server logs:\n```bash\ncat ~/.config/draw-things/server.log\n```\n\n### Connection Issues\n\n1. Verify server is running:\n```bash\ndts-util test\n```\n\n2. Check port availability:\n```bash\ndts-util test --port 7860\n```\n\n3. Check TLS configuration:\n```bash\n# If using TLS, ensure your client is configured correctly\n# You can verify server configuration in ~/.config/draw-things/server.conf\n```\n\n## Advanced Usage\n\n### Package Structure\n\nThe package is organized into several modules:\n\n```\nsrc/\n├── dts_util/\n│   ├── installer/               # Server installation and management\n│   ├── grpc/                    # Client communication tools\n│   └── utils/                   # Shared utilities\n```\n\n### Complete Installation Options\n\nFor advanced users, here are all available installation options:\n\n```bash\n# Basic settings\ndts-util install --port 7860 --model-path /path/to/model\n\n# Security settings\ndts-util install --shared-secret \"your-secret-here\"\n\n# Advanced settings\ndts-util install --model-browser --debug --no-flash-attention\n```\n\n### Python Client Examples\n\n#### Basic Image Generation\n\n```python\nfrom dts_util.grpc.utils import create_channel_and_stub, handle_grpc_error\nfrom dts_util.grpc.proto.image_generation_pb2 import GenerateImageRequest\n\n# Connect to server\nchannel, stub = create_channel_and_stub(port=7859)\n\n# Generate image\nwith handle_grpc_error():\n    response = stub.GenerateImage(GenerateImageRequest(\n        prompt=\"a beautiful landscape\",\n        negative_prompt=\"blurry, low quality\",\n        width=512,\n        height=512\n    ))\n```\n\n#### Error Handling\n\n```python\nfrom dts_util.grpc.utils import handle_grpc_error\n\ntry:\n    with handle_grpc_error():\n        # Your code here\n        pass\nexcept Exception as e:\n    print(f\"Error occurred: {e}\")\n```\n\n## Documentation\n\n### Package Documentation\n- [API Documentation](API.md): Documentation for this package's utilities and functions\n- [CLI Reference](CLI.md): Complete reference for the `dts-util` command-line tool\n\n### Draw Things gRPC Server Documentation\n- [Protocol Buffer Specifications](PROTOBUF.md): Documentation of the gRPC server's API and message definitions\n- For complete server documentation, please refer to the [Draw Things documentation](https://drawthings.ai/docs)\n\n## Development\n\n### Requirements\n\n- Python 3.8+\n- gRPC tools\n- Protocol Buffers compiler\n\n### Setting Up Development\n\n```bash\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest tests/\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkatron%2Fdts-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkatron%2Fdts-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkatron%2Fdts-utils/lists"}