stable-diffusion-rest.service.template 823 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. [Unit]
  2. Description=Stable Diffusion REST API Server
  3. After=network.target
  4. Documentation=https://github.com/stable-diffusion-rest
  5. [Service]
  6. Type=simple
  7. User={{USER}}
  8. Group={{USER}}
  9. WorkingDirectory={{INSTALL_DIR}}
  10. ExecStart={{INSTALL_DIR}}/stable-diffusion-rest-server \
  11. --models-dir {{MODELS_DIR}} \
  12. --checkpoints checkpoints \
  13. --host 0.0.0.0 \
  14. --port 8080 \
  15. {{LOGGING_OPTIONS}}
  16. # Restart behavior
  17. Restart=on-failure
  18. RestartSec=10s
  19. # Security hardening
  20. NoNewPrivileges=true
  21. PrivateTmp=true
  22. ProtectSystem=strict
  23. ProtectHome=true
  24. ReadWritePaths={{QUEUE_DIR}} {{OUTPUT_DIR}} {{LOG_DIR}}
  25. # Standard output/error configuration
  26. StandardOutput=journal
  27. StandardError=journal
  28. SyslogIdentifier=stable-diffusion-rest
  29. # Resource limits (adjust as needed)
  30. LimitNOFILE=65536
  31. [Install]
  32. WantedBy=multi-user.target