Add optional per-image-profile Qwen prompt enhancers

This commit is contained in:
Mikei386
2026-09-29 21:16:40 +02:00
parent 7ba17308f5
commit c5a028cba9
13 changed files with 363 additions and 19 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ def read_image_upload(handler,profile_field='model'):
if mime not in ('image/png','image/jpeg','image/webp'):raise ValueError('Nur PNG, JPEG oder WebP erlaubt.')
images.append('data:'+mime+';base64,'+base64.b64encode(data).decode('ascii'))
else:
if name not in (profile_field,'prompt','size','n','response_format') or name in fields or len(data)>4096:raise ValueError('Ungültiges oder doppeltes Formularfeld.')
if name not in (profile_field,'prompt','size','n','response_format','skip_enhancer') or name in fields or len(data)>4096:raise ValueError('Ungültiges oder doppeltes Formularfeld.')
try:fields[name]=data.decode('utf-8')
except UnicodeError:raise ValueError('Ungültiges Textfeld.') from None
if profile_field not in fields:raise ValueError('Bildprofil fehlt.')