IMage genartion service and models revamp - #Migration Runs

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-03 20:08:16 +00:00
parent a70f8cdd01
commit f518e1751b
15 changed files with 817 additions and 287 deletions

View File

@@ -63,8 +63,9 @@ def get_image_model_choices(provider=None):
]
elif provider == 'runware':
return [
('runware:97@1', 'Hi Dream Full - Standard'),
('civitai:618692@691639', 'Bria 3.2 - Premium'),
('runware:97@1', 'Hi Dream Full - Basic'),
('bria:10@1', 'Bria 3.2 - Quality'),
('google:4@2', 'Nano Banana - Premium'),
]
return []
@@ -171,10 +172,21 @@ class GlobalIntegrationSettings(models.Model):
]
RUNWARE_MODEL_CHOICES = [
('runware:97@1', 'Hi Dream Full - Standard'),
('civitai:618692@691639', 'Bria 3.2 - Premium'),
('runware:97@1', 'Hi Dream Full - Basic'),
('bria:10@1', 'Bria 3.2 - Quality'),
('google:4@2', 'Nano Banana - Premium'),
]
# Model-specific landscape sizes (square is always 1024x1024 for all models)
MODEL_LANDSCAPE_SIZES = {
'runware:97@1': '1280x768', # Hi Dream Full landscape
'bria:10@1': '1344x768', # Bria 3.2 landscape (16:9)
'google:4@2': '1376x768', # Nano Banana landscape (16:9)
}
# Default square size (universal across all models)
DEFAULT_SQUARE_SIZE = '1024x1024'
BRIA_MODEL_CHOICES = [
('bria-2.3', 'Bria 2.3 - High Quality ($0.015/image)'),
('bria-2.3-fast', 'Bria 2.3 Fast - Quick Generation ($0.010/image)'),
@@ -335,13 +347,9 @@ class GlobalIntegrationSettings(models.Model):
desktop_image_size = models.CharField(
max_length=20,
default='1024x1024',
help_text="Default desktop image size (accounts can override if plan allows)"
)
mobile_image_size = models.CharField(
max_length=20,
default='512x512',
help_text="Default mobile image size (accounts can override if plan allows)"
help_text="Default image size for in-article images (accounts can override if plan allows)"
)
# Note: mobile_image_size removed - no longer needed
# Metadata
is_active = models.BooleanField(default=True)

View File

@@ -0,0 +1,43 @@
# Generated migration for updating Runware image models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0013_add_anthropic_integration'),
]
operations = [
# Update runware_model field with new model choices
migrations.AlterField(
model_name='globalintegrationsettings',
name='runware_model',
field=models.CharField(
choices=[
('runware:97@1', 'Hi Dream Full - Basic'),
('bria:10@1', 'Bria 3.2 - Quality'),
('google:4@2', 'Nano Banana - Premium'),
],
default='runware:97@1',
help_text='Default Runware model (accounts can override if plan allows)',
max_length=100,
),
),
# Update desktop_image_size help text (mobile removed)
migrations.AlterField(
model_name='globalintegrationsettings',
name='desktop_image_size',
field=models.CharField(
default='1024x1024',
help_text='Default image size for in-article images (accounts can override if plan allows)',
max_length=20,
),
),
# Remove mobile_image_size field if it exists (safe removal)
migrations.RemoveField(
model_name='globalintegrationsettings',
name='mobile_image_size',
),
]