feat: add getSystemStats method to retrieve system statistics

This commit is contained in:
2025-07-08 22:49:10 +02:00
parent bbfe76e64e
commit 64687545ee
2 changed files with 11 additions and 0 deletions

View File

@@ -160,6 +160,13 @@ class ComfyApiHttpEndpoints {
return jsonDecode(response.body);
}
/// Gets system stats, including OS, Python version, etc.
Future<Map<String, dynamic>> getSystemStats() async {
final response = await _httpClient.get(Uri.parse('$host/system_stats'));
_validateResponse(response);
return jsonDecode(response.body);
}
/// Gets a list of possible samplers from the object info
Future<List<String>> getKSamplers() async {
final objectInfo = await getObjectInfo();

View File

@@ -143,6 +143,10 @@ class ComfyUiApi {
Future<Map<String, dynamic>> getObjectInfo() =>
_httpEndpoints.getObjectInfo();
/// Gets system stats from the server
Future<Map<String, dynamic>> getSystemStats() =>
_httpEndpoints.getSystemStats();
/// Gets a list of possible samplers from the object info
Future<List<String>> getKSamplers() => _httpEndpoints.getKSamplers();