|
|
@@ -662,7 +662,23 @@ bool ModelManager::loadModel(const std::string& name, const std::string& path, M
|
|
|
// Set additional model paths based on detection
|
|
|
// VAE is now optional for SD1x and SDXL models, but we still set it if available
|
|
|
if (!detection.recommendedVAE.empty()) {
|
|
|
- loadParams.vaePath = detection.recommendedVAE;
|
|
|
+ // Resolve VAE filename to full path using the VAE directory
|
|
|
+ std::string vaeDirectory = getModelTypeDirectory(ModelType::VAE);
|
|
|
+ if (!vaeDirectory.empty()) {
|
|
|
+ std::string resolvedVAEPath = vaeDirectory + "/" + detection.recommendedVAE;
|
|
|
+
|
|
|
+ // Check if the resolved VAE file exists before setting the path
|
|
|
+ if (fs::exists(resolvedVAEPath) && fs::is_regular_file(resolvedVAEPath)) {
|
|
|
+ loadParams.vaePath = resolvedVAEPath;
|
|
|
+ std::cout << "Using VAE: " << fs::absolute(resolvedVAEPath).string() << std::endl;
|
|
|
+ } else {
|
|
|
+ std::cout << "VAE file not found: \"" << fs::absolute(resolvedVAEPath).string()
|
|
|
+ << "\" - continuing without VAE" << std::endl;
|
|
|
+ // Don't set vaePath if file doesn't exist, continue without VAE
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ std::cerr << "VAE directory not configured - continuing without VAE" << std::endl;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Apply other suggested parameters (only for fields that exist in GenerationParams)
|