Add ability to send images over lora

This commit is contained in:
Zach committed 2026-08-10 23:20:46 -07:00
1 parent 736eb064bf
commit eee72b4c65
129 files changed
+27099 -58

No files matched your search

+52
View File
@@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:flutter/foundation.dart';
import '../models/app_settings.dart';
import '../models/image_codec_support.dart';
import '../models/translation_support.dart';
import '../storage/prefs_manager.dart';
import '../utils/app_logger.dart';
@@ -280,6 +281,57 @@ class AppSettingsService extends ChangeNotifier {
await updateSettings(_settings.copyWith(jumpToOldestUnread: value));
}
Future<void> setImageMessagesEnabled(bool value) async {
await updateSettings(_settings.copyWith(imageMessagesEnabled: value));
}
/// See [AppSettings.imageProcessAutomatically]. `main.dart` mirrors this into
/// `ReceivedImageStore.processAutomatically` on every settings change; the
/// store applies it to future arrivals only, so flipping it does not
/// retroactively decode a backlog.
Future<void> setImageProcessAutomatically(bool value) async {
await updateSettings(_settings.copyWith(imageProcessAutomatically: value));
}
// ---- neural image codec (AEIC-SE) ---------------------------------------
Future<void> setImageCodecEnabled(bool value) async {
await updateSettings(_settings.copyWith(imageCodecEnabled: value));
}
Future<void> setImageCodecSelectedModelId(String? value) async {
await updateSettings(_settings.copyWith(imageCodecSelectedModelId: value));
}
Future<void> setImageCodecModelSourceUrl(String? value) async {
await updateSettings(_settings.copyWith(imageCodecModelSourceUrl: value));
}
/// [value] is an [AeicRatePoint.wireValue], not an enum index.
Future<void> setImageCodecRatePoint(int value) async {
await updateSettings(_settings.copyWith(imageCodecRatePoint: value));
}
Future<void> setImageCodecDownloadedModels(
List<ImageCodecModelRecord> value,
) async {
await updateSettings(_settings.copyWith(imageCodecDownloadedModels: value));
}
/// Writes the whole block in one persist, which is what
/// `ImageCodecService` does on every preference change.
Future<void> setImageCodecPreferences(ImageCodecPreferences value) async {
await updateSettings(
_settings.copyWith(
imageCodecEnabled: value.enabled,
imageCodecSelectedModelId: value.selectedModelId,
imageCodecModelSourceUrl: value.modelSourceUrl,
imageCodecRatePoint: value.ratePoint,
imageCodecDownloadedModels: value.downloadedModels,
),
);
}
Future<void> setTranslationEnabled(bool value) async {
await updateSettings(_settings.copyWith(translationEnabled: value));
}