Image genartiona dn temaplte design redesign

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-10 03:58:02 +00:00
parent ce66dadc00
commit 0c693dc1cc
18 changed files with 1717 additions and 214 deletions

View File

@@ -816,6 +816,27 @@ class AIModelConfig(models.Model):
help_text="basic / quality / premium - for image models"
)
# Image Size Configuration (for image models)
landscape_size = models.CharField(
max_length=20,
null=True,
blank=True,
help_text="Landscape image size for this model (e.g., '1792x1024', '1280x768')"
)
square_size = models.CharField(
max_length=20,
default='1024x1024',
blank=True,
help_text="Square image size for this model (e.g., '1024x1024')"
)
valid_sizes = models.JSONField(
default=list,
blank=True,
help_text="List of valid sizes for this model (e.g., ['1024x1024', '1792x1024'])"
)
# Model Limits
max_tokens = models.IntegerField(
null=True,
@@ -884,6 +905,21 @@ class AIModelConfig(models.Model):
model_type='image',
is_active=True
).order_by('quality_tier', 'model_name')
def validate_size(self, size: str) -> bool:
"""Validate that the given size is valid for this image model"""
if not self.valid_sizes:
# If no valid_sizes defined, accept common sizes
return True
return size in self.valid_sizes
def get_landscape_size(self) -> str:
"""Get the landscape size for this model"""
return self.landscape_size or '1792x1024'
def get_square_size(self) -> str:
"""Get the square size for this model"""
return self.square_size or '1024x1024'
class WebhookEvent(models.Model):