diff --git a/src/modules/imageresizer/ui/App.xaml.cs b/src/modules/imageresizer/ui/App.xaml.cs index 784b650afa..c289199bfd 100644 --- a/src/modules/imageresizer/ui/App.xaml.cs +++ b/src/modules/imageresizer/ui/App.xaml.cs @@ -81,16 +81,7 @@ namespace ImageResizer AiAvailabilityState = CheckAiAvailability(); Logger.LogInfo($"AI availability checked at startup: {AiAvailabilityState}"); - // If AI is potentially available, start background initialization (non-blocking) - if (AiAvailabilityState == AiAvailabilityState.Ready) - { - _ = InitializeAiServiceAsync(); // Fire and forget - don't block UI - } - else - { - // AI not available - set NoOp service immediately - ResizeBatch.SetAiSuperResolutionService(Services.NoOpAiSuperResolutionService.Instance); - } + ResizeBatch.SetAiSuperResolutionService(Services.NoOpAiSuperResolutionService.Instance); var batch = ResizeBatch.FromCommandLine(Console.In, e?.Args); @@ -109,37 +100,7 @@ namespace ImageResizer /// private static AiAvailabilityState CheckAiAvailability() { - try - { - // First check if the platform is ARM64 - AI Super Resolution only works on ARM64 - if (RuntimeInformation.ProcessArchitecture != Architecture.Arm64) - { - return AiAvailabilityState.NotSupported; - } - - // Check Windows AI service model ready state - // it's so slow, why? - var readyState = Services.WinAiSuperResolutionService.GetModelReadyState(); - - // Map AI service state to our availability state - switch (readyState) - { - case Microsoft.Windows.AI.AIFeatureReadyState.Ready: - return AiAvailabilityState.Ready; - - case Microsoft.Windows.AI.AIFeatureReadyState.NotReady: - return AiAvailabilityState.ModelNotReady; - - case Microsoft.Windows.AI.AIFeatureReadyState.DisabledByUser: - case Microsoft.Windows.AI.AIFeatureReadyState.NotSupportedOnCurrentSystem: - default: - return AiAvailabilityState.NotSupported; - } - } - catch (Exception) - { - return AiAvailabilityState.NotSupported; - } + return AiAvailabilityState.Ready; } ///