Stable Diffusion API /sdapi/v1/txt2img的完整参数列表及其说明

基本参数

{
  "prompt": "高质量,精细的恐龙",  // 主提示词
  "negative_prompt": "模糊,低质量",  // 负面提示词
  "styles": ["photorealistic", "detailed"],  // 应用的风格预设
  "seed": 42,  // 随机种子,-1为随机
  "subseed": -1,  // 次级种子
  "subseed_strength": 0.3,  // 次级种子影响强度(0-1)
  "seed_resize_from_h": -1,  // 高度方向上调整种子大小的来源
  "seed_resize_from_w": -1,  // 宽度方向上调整种子大小的来源
  "sampler_name": "DPM++ 2M Karras",  // 采样器名称
  "scheduler": "karras",  // 调度器类型
  "batch_size": 1,  // 单次生成的图像数量
  "n_iter": 1,  // 迭代次数
  "steps": 30,  // 采样步数
  "cfg_scale": 7,  // 提示词引导强度
  "distilled_cfg_scale": 3.5,  // 蒸馏模型的CFG缩放
  "width": 768,  // 图像宽度(像素)
  "height": 512,  // 图像高度(像素)
  "restore_faces": true,  // 是否使用面部恢复
  "tiling": false,  // 是否生成可平铺纹理
  "do_not_save_samples": false,  // 是否不保存样本
  "do_not_save_grid": false,  // 是否不保存网格
  "eta": 0,  // ETA参数
  "denoising_strength": 0.75,  // 去噪强度(0-1)
  "s_min_uncond": 0,  // 最小无条件缩放
  "s_churn": 0,  // 周转率
  "s_tmax": 0,  // 最大时间步长
  "s_tmin": 0,  // 最小时间步长
  "s_noise": 0,  // 噪声量
  "override_settings": {  // 临时覆盖WebUI设置
    "sd_model_checkpoint": "dreamshaper_8.safetensors",  // 模型检查点
    "CLIP_stop_at_last_layers": 2,  // CLIP层数
    "eta_noise_seed_delta": 0,  // 噪声种子增量
    "sd_vae": "vae-ft-mse-840000.safetensors"  // VAE模型
  },
  "override_settings_restore_afterwards": true,  // 处理完后是否恢复覆盖的设置
  "refiner_checkpoint": "sd_xl_refiner_1.0.safetensors",  // 细化模型检查点
  "refiner_switch_at": 0.8,  // 细化模型切换时机(0-1)
  "disable_extra_networks": false,  // 是否禁用额外网络
  "firstpass_image": "base64...",  // 第一遍图像(用于img2img)
  "comments": {  // 注释,可用于存储元数据
    "author": "用户名",
    "creation_date": "2023-10-15"
  }
}

高分辨率修复参数

{
  "enable_hr": true,  // 是否启用高分辨率修复
  "firstphase_width": 512,  // 第一阶段宽度
  "firstphase_height": 512,  // 第一阶段高度
  "hr_scale": 2,  // 高分辨率缩放因子
  "hr_upscaler": "Latent (bicubic antialiased)",  // 高分辨率上采样器
  "hr_second_pass_steps": 20,  // 高分辨率第二阶段步数
  "hr_resize_x": 1024,  // 高分辨率调整后的宽度
  "hr_resize_y": 1024,  // 高分辨率调整后的高度
  "hr_checkpoint_name": "sd_xl_base_1.0.safetensors",  // 高分辨率使用的检查点
  "hr_additional_modules": ["photoreal"],  // 高分辨率额外模块
  "hr_sampler_name": "Euler a",  // 高分辨率采样器
  "hr_scheduler": "normal",  // 高分辨率调度器
  "hr_prompt": "",  // 高分辨率专用提示词(为空则使用普通提示词)
  "hr_negative_prompt": "",  // 高分辨率专用负面提示词
  "hr_cfg": 8,  // 高分辨率CFG值
  "hr_distilled_cfg": 3.5  // 高分辨率蒸馏CFG值
}

Always-On 脚本参数

"alwayson_scripts": {
  "controlnet": {
    "args": [
      {
        "enabled": true,  // 是否启用
        "module": "depth",  // 控制模块类型
        "model": "diff_control_sd15_depth_fp16 [978ef0a1]",  // 模型名称
        "weight": 1.0,  // 权重
        "image": "base64...",  // Base64编码的输入图像
        "mask": "base64...",  // 遮罩(可选)
        "resize_mode": 1,  // 调整大小模式:0=只调整大小,1=裁剪匹配,2=填充匹配
        "low_vram": false,  // 低VRAM模式
        "processor_res": 512,  // 处理器分辨率
        "threshold_a": 64,  // 阈值A
        "threshold_b": 64,  // 阈值B
        "guidance_start": 0.0,  // 指导开始
        "guidance_end": 1.0,  // 指导结束
        "control_mode": 0,  // 控制模式: 0=平衡, 1=仅提示词, 2=仅控制
        "pixel_perfect": false  // 像素完美
      },
      {
        "enabled": true,  // 可以有多个ControlNet条目
        "module": "canny",
        "model": "diff_control_sd15_canny_fp16 [3b9d7d0e]",
        // ... 其他参数
      }
    ]
  }
}

脚本和系统参数

{
  "force_task_id": "12345",  // 强制任务ID
  "sampler_index": "Euler",  // 兼容旧版本的采样器索引
  "script_name": "ultimate sd upscale",  // 脚本名称
  "script_args": [true, 64, "复杂参数"],  // 脚本参数列表
  "send_images": true,  // 是否在响应中返回图像
  "save_images": false,  // 是否保存图像到磁盘
  "infotext": "custom info text"  // 信息文本
}

ADetailer(自动细节增强)

"alwayson_scripts": {
  "ADetailer": {
    "args": [
      {
        "enabled": true,
        "ad_model": "face_yolov8n.pt",  // 面部检测模型
        "ad_prompt": "美丽的脸,高清细节",  // 面部提示词
        "ad_negative_prompt": "模糊,变形",  // 面部负面提示词
        "ad_confidence": 0.3,  // 检测置信度
        "ad_denoising_strength": 0.4,  // 去噪强度
        "ad_inpaint_only_masked": true,  // 是否仅修补遮罩区域
        "ad_inpaint_width": 512,  // 修补宽度
        "ad_inpaint_height": 512,  // 修补高度
        "ad_mask_blur": 4,  // 遮罩模糊
        "ad_dilate_erode": 4  // 扩张/侵蚀
      }
    ]
  }
}

DynamicPrompts

"alwayson_scripts": {
  "Dynamic Prompts": {
    "args": [
      true,  // 启用/禁用
      "强化变体策略",  // 变体策略
      true,  // 使用魔术提示
      "combinatorial",  // 组合方法
      "",  // 批次前缀
      2  // 每个提示词的变体数量
    ]
  }
}

X/Y/Z 图表

"alwayson_scripts": {
  "X/Y/Z plot": {
    "args": [
      true,  // 启用
      "Prompt S/R",  // X类型
      "Steps",  // Y类型
      "Nothing",  // Z类型
      "cat, dog, bird",  // X值
      "10, 20, 30",  // Y值
      "",  // Z值
      true,  // 绘制图例
      true,  // 保持种子不变
      "grid"  // 绘图格式
    ]
  }
}

LoRA 块权重

"alwayson_scripts": {
  "LoRA Block Weight": {
    "args": [
      true,  // 启用
      {
        "lora_name": "my_lora",
        "base_model_weights": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        "base_model_multipliers": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
      }
    ]
  }
}

完整示例

{
  "prompt": "高质量,精细的恐龙,逼真的鳞片和肌肉细节,自然栖息地",
  "negative_prompt": "模糊,低质量,变形,扭曲的解剖结构",
  "styles": ["photorealistic"],
  "seed": 42,
  "subseed": -1,
  "subseed_strength": 0,
  "seed_resize_from_h": -1,
  "seed_resize_from_w": -1,
  "sampler_name": "DPM++ 2M Karras",
  "scheduler": "karras",
  "batch_size": 1,
  "n_iter": 1,
  "steps": 30,
  "cfg_scale": 7,
  "distilled_cfg_scale": 3.5,
  "width": 768,
  "height": 512,
  "restore_faces": true,
  "tiling": false,
  "do_not_save_samples": false,
  "do_not_save_grid": false,
  "eta": 0,
  "denoising_strength": 0,
  "s_min_uncond": 0,
  "s_churn": 0,
  "s_tmax": 0,
  "s_tmin": 0,
  "s_noise": 0,
  "override_settings": {
    "sd_model_checkpoint": "F.1-fp8_11G版_flux1-Schnell.safetensors",
    "CLIP_stop_at_last_layers": 2
  },
  "override_settings_restore_afterwards": true,
  "refiner_checkpoint": "sd_xl_refiner_1.0.safetensors",
  "refiner_switch_at": 0.8,
  "disable_extra_networks": false,
  "comments": {},
  "enable_hr": false,
  "firstphase_width": 0,
  "firstphase_height": 0,
  "hr_scale": 2,
  "hr_upscaler": "Latent (bicubic antialiased)",
  "hr_second_pass_steps": 20,
  "hr_resize_x": 0,
  "hr_resize_y": 0,
  "hr_checkpoint_name": "",
  "hr_additional_modules": [],
  "hr_sampler_name": "",
  "hr_scheduler": "",
  "hr_prompt": "",
  "hr_negative_prompt": "",
  "hr_cfg": 0,
  "hr_distilled_cfg": 3.5,
  "force_task_id": "",
  "sampler_index": "Euler",
  "script_name": "",
  "script_args": [],
  "send_images": true,
  "save_images": false,
  "alwayson_scripts": {
    "controlnet": {
      "args": [
        {
          "enabled": true,
          "module": "depth",
          "model": "diff_control_sd15_depth_fp16 [978ef0a1]",
          "weight": 1.0,
          "image": "base64...",
          "resize_mode": 1,
          "low_vram": false,
          "processor_res": 512,
          "threshold_a": 64,
          "threshold_b": 64,
          "guidance_start": 0.0,
          "guidance_end": 1.0,
          "control_mode": 0,
          "pixel_perfect": false
        }
      ]
    },
    "ADetailer": {
      "args": [
        {
          "enabled": true,
          "ad_model": "face_yolov8n.pt",
          "ad_prompt": "",
          "ad_negative_prompt": "",
          "ad_confidence": 0.3,
          "ad_denoising_strength": 0.4
        }
      ]
    }
  }
}

<think>好的,我需要处理用户关于RunwayML的Stable Diffusion v1-5模型的查询。首先,用户想了解这个模型的介绍、下载方式和使用教程。根据提供的引用信息,用户可能已经有一些Stable Diffusion的基础知识,比如知道模型存放在`sd-webui-aki-v4\models\Stable-diffusion`目录下,并且需要ControlNet模型。不过引用内容里提到的教程链接并不直接关联到RunwayML的版本,所以我需要补充RunwayML的具体信息。 首先,我需要确认RunwayML发布的Stable Diffusion v1-5模型的基本信息。这个模型是基于Stable Diffusion 1.5的官方版本,可能由RunwayML进行了优化或调整,适用于他们的平台。需要说明模型的结构、训练数据、应用场景等。 关于下载,用户可能需要前往RunwayML的官方网站或者Hugging Face的模型库查找。需要指出具体的下载页面,并提醒用户注意模型的使用许可协议。例如,Hugging Face上通常会有模型的页面,提供下载链接和说明。 使用教程方面,用户可能需要安装Stable Diffusion的WebUI,比如Automatic1111的版本,然后将模型文件放入正确的目录。此外,RunwayML可能有自己的使用指南,需要引导用户参考官方文档。如果用户需要生成图像的具体步骤,可以简单说明参数设置和提示词的使用。 需要检查是否有遗漏的信息,比如系统要求、依赖项或常见问题。另外,用户可能关心与其他版本的区别,比如和官方Stable Diffusion 1.5的不同之处,或者是否需要额外的工具如ControlNet。根据引用中提到的ControlNet模型,可能需要提醒用户在需要时下载并配置。 最后,生成相关问题时,要围绕RunwayML的模型特点、下载安装、使用技巧、与其他工具整合等方面。确保问题有针对性,帮助用户深入理解。 现在整理回答结构:先介绍模型,再分点说明下载步骤和使用教程,最后提供相关问题。注意使用正确的LaTeX格式,虽然这个问题可能不太涉及数学公式,但如果有技术术语或版本号,可能需要用行内格式。同时,确保引用标识正确添加。</think>### RunwayML Stable Diffusion v1-5 模型介绍与使用指南 #### 1. **模型介绍** RunwayML Stable Diffusion v1-5 是基于 Stability AI 发布的 Stable Diffusion 1.5 版本优化而来的模型,专注于图像生成与编辑任务。其特点包括: - **高分辨率支持**:支持生成分辨率达 $512 \times 512$ 至 $1024 \times 1024$ 的图像。 - **多场景适用**:适用于艺术创作、设计辅助、影视特效等场景。 - **开源与社区驱动**:模型权重和代码通过 Hugging Face 等平台公开,支持本地部署[^1]。 #### 2. **模型下载** **步骤说明**: 1. 访问官方渠道: - **Hugging Face 模型库**:[Stable Diffusion v1-5 页面](https://huggingface.co/runwayml/stable-diffusion-v1-5) 提供模型文件(`.ckpt` 或 `.safetensors`)。 - **RunwayML 官网**:部分版本可能需要通过其平台获取权限。 2. 下载后,将模型文件放置在 Stable Diffusion WebUI 的模型目录,例如: ``` sd-webui-aki-v4\models\Stable-diffusion\ ``` 3. 若需使用 ControlNet 等扩展功能,需额外下载对应模型并放入 `extensions/sd-webui-controlnet/models`。 #### 3. **使用教程** **基础流程**: 1. **启动 WebUI**:运行 `webui-user.bat` 启动界面。 2. **选择模型**:在 WebUI 顶部下拉菜单选择 `runwayml/stable-diffusion-v1-5`。 3. **输入提示词**:例如 `"a futuristic cityscape, digital art, 4k"`。 4. **调整参数**: - 采样步数(Steps):20-30 - 采样器(Sampler):推荐 `Euler a` 或 `DPM++ 2M Karras` - 分辨率(Resolution):$768 \times 768$ 5. **生成与优化**:可通过添加负面提示词(Negative Prompt)或使用 img2img 功能优化结果。 **进阶功能**: - **ControlNet 集成**:通过边缘检测、姿态估计等控制生成细节。 - **LoRA/Textual Inversion**:加载风格化微调模型扩展创作可能性。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值