isLoraInstalled property

  1. @override
Future<bool> get isLoraInstalled
override

Whether the lora weights are installed (i.e. downloaded, copied from assets or path to the file is set manually) and ready to use.

Implementation

@override
Future<bool> get isLoraInstalled async {
  if (_loraCompleter != null) return await _loraCompleter!.future;

  final prefs = await _prefs;
  final name = prefs.getString(_prefsLoraKey);
  if (name == null) return false;

  _loraFileName = name;
  final file = await _loraFile;
  return file != null && await file.exists();
}