You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

LM Studio 0.2.31加载stable-diffusion模型失败如何解决?

解决LM Studio加载stable-diffusion-v1-5-pruned-emaonly-f32.gguf时的重复张量错误

问题详情

在使用LM Studio 0.2.31加载stable-diffusion-v1-5-pruned-emaonly-f32.gguf模型时,触发llama.cpp错误:

llama.cpp error: 'invalid model: tensor 'cond_stage_model.transformer.text_model.encoder.layers.0.layer_' is duplicated'

相关配置信息:

{
 "title": "Failed to load model",
 "cause": "llama.cpp error: 'invalid model: tensor 'cond_stage_model.transformer.text_model.encoder.layers.0.layer_' is duplicated'",
 "errorData": {
 "n_ctx": 2048,
 "n_batch": 512,
 "n_gpu_layers": 20
 },
 "data": {
 "memory": {
 "ram_capacity": "31.91 GB",
 "ram_unused": "14.17 GB"
 },
 "gpu": {
 "gpu_names": [
 "NVIDIA GeForce RTX 4070"
 ],
 "vram_recommended_capacity": "11.99 GB",
 "vram_unused": "10.85 GB"
 },
 "os": {
 "platform": "win32",
 "version": "10.0.22631"
 },
 "app": {
 "version": "0.2.31",
 "downloadsDir": "C:\Users\barba\.cache\lm-studio\models"
 },
 "model": {}
 }
}

解决方案

  • 换用专业图像生成工具加载:LM Studio核心基于llama.cpp,主打大语言模型(LLM)支持,Stable Diffusion属于图像生成类扩散模型,兼容性有限。直接用Automatic1111 WebUI、ComfyUI这类专门的SD工具加载该模型,是最稳妥的解决方式。
  • 重新获取模型文件:删除本地C:\Users\barba\.cache\lm-studio\models下的目标模型文件,从官方或可信渠道重新下载适配llama.cpp的SD GGUF模型;也可以用官方转换工具重新将SD模型转为GGUF格式,避免转换过程中出现张量重复问题。
  • 调整LM Studio加载参数:尝试将n_gpu_layers设为0(纯CPU加载测试),排除GPU层解析导致的报错;同时把n_batch调至64等较小数值,降低加载时的内存压力。
  • 升级LM Studio版本:当前0.2.31版本可能存在非LLM类GGUF模型的兼容bug,升级到最新版本后再尝试加载,看是否已修复该问题。

内容的提问来源于stack exchange,提问作者Babak A

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 03:47:04