Add REST API for preset-based generation and fallback cover images
REST API (routes/api.py): Three endpoints behind API key auth for programmatic image generation via presets — list presets, queue generation with optional overrides, and poll job status. Shared generation logic extracted from routes/presets.py into services/generation.py so both web UI and API use the same code path. Fallback covers: library index pages now show a random generated image at reduced opacity when no cover is assigned, instead of "No Image". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -291,6 +291,8 @@ class Settings(db.Model):
|
||||
checkpoint_dirs = db.Column(db.String(1000), default='/ImageModels/Stable-diffusion/Illustrious,/ImageModels/Stable-diffusion/Noob')
|
||||
# Default checkpoint path (persisted across server restarts)
|
||||
default_checkpoint = db.Column(db.String(500), nullable=True)
|
||||
# API key for REST API authentication
|
||||
api_key = db.Column(db.String(255), nullable=True)
|
||||
|
||||
def __repr__(self):
|
||||
return '<Settings>'
|
||||
|
||||
Reference in New Issue
Block a user