image strugles 2
This commit is contained in:
@@ -1026,11 +1026,19 @@ class AICore:
|
||||
del inference_task['height']
|
||||
inference_task['resolution'] = '1k' # Use 1K tier for optimal speed/quality
|
||||
print(f"[AI][{function_name}] Using Nano Banana config: resolution=1k (no width/height)")
|
||||
else:
|
||||
elif runware_model.startswith('bytedance:'):
|
||||
# Seedream 4.5 (bytedance:seedream@4.5) - High quality ByteDance model
|
||||
# Uses basic format with just width/height - no steps, CFGScale, or special providerSettings needed
|
||||
# Just use the base inference_task as-is
|
||||
print(f"[AI][{function_name}] Using Seedream 4.5 config: basic format, width={width}, height={height}")
|
||||
elif runware_model.startswith('runware:'):
|
||||
# Hi Dream Full (runware:97@1) - General diffusion, steps 20, CFGScale 7
|
||||
inference_task['steps'] = 20
|
||||
inference_task['CFGScale'] = 7
|
||||
print(f"[AI][{function_name}] Using Hi Dream Full config: steps=20, CFGScale=7")
|
||||
else:
|
||||
# Unknown model - use basic format without extra parameters
|
||||
print(f"[AI][{function_name}] Using basic format for unknown model: {runware_model}")
|
||||
|
||||
payload = [
|
||||
{
|
||||
|
||||
@@ -70,22 +70,37 @@ class GenerateImagesFunction(BaseAIFunction):
|
||||
# Get image generation settings from AISettings (with account overrides)
|
||||
from igny8_core.modules.system.ai_settings import AISettings
|
||||
from igny8_core.ai.model_registry import ModelRegistry
|
||||
from igny8_core.business.billing.models import AIModelConfig
|
||||
|
||||
# Get effective settings (AISettings + AccountSettings overrides)
|
||||
image_style = AISettings.get_effective_image_style(account)
|
||||
max_images = AISettings.get_effective_max_images(account)
|
||||
quality_tier = AISettings.get_effective_quality_tier(account)
|
||||
|
||||
# Get default image model and provider from database
|
||||
default_model = ModelRegistry.get_default_model('image')
|
||||
if default_model:
|
||||
model_config = ModelRegistry.get_model(default_model)
|
||||
provider = model_config.provider if model_config else 'openai'
|
||||
model = default_model
|
||||
# Get image model based on user's selected quality tier
|
||||
selected_model = None
|
||||
if quality_tier:
|
||||
selected_model = AIModelConfig.objects.filter(
|
||||
model_type='image',
|
||||
quality_tier=quality_tier,
|
||||
is_active=True
|
||||
).first()
|
||||
|
||||
# Fall back to default model if no tier match
|
||||
if not selected_model:
|
||||
default_model_name = ModelRegistry.get_default_model('image')
|
||||
if default_model_name:
|
||||
selected_model = ModelRegistry.get_model(default_model_name)
|
||||
|
||||
# Set provider and model from selected model
|
||||
if selected_model:
|
||||
provider = selected_model.provider if selected_model.provider else 'openai'
|
||||
model = selected_model.model_name
|
||||
else:
|
||||
provider = 'openai'
|
||||
model = 'dall-e-3'
|
||||
|
||||
logger.info(f"Using image settings: provider={provider}, model={model}, style={image_style}, max={max_images}")
|
||||
logger.info(f"Using image settings: provider={provider}, model={model}, tier={quality_tier}, style={image_style}, max={max_images}")
|
||||
|
||||
return {
|
||||
'tasks': tasks,
|
||||
|
||||
Reference in New Issue
Block a user