遇见 YOLO26: 下一代视觉 AI。
Ultralytics
返回 Ultralytics 词汇表

Latent Consistency Models (LCMs)

发现潜在一致性模型 (LCM) 如何加速生成式 AI。了解它们如何实现 1-4 步实时图像生成,从而支持交互式设计。

潜空间一致性模型 (LCMs) 代表了 生成式 AI 领域的一项重大突破,旨在显著加速图像和视频生成过程。传统的扩散模型需要缓慢的迭代去噪过程,通常需要数十步才能生成高质量图像。LCMs 通过学习直接从生成时间轴上的任何点预测最终的、完全去噪的输出,从而克服了这一瓶颈。通过在压缩的潜空间而不是原始图像像素上运行,LCMs 实现了卓越的计算效率,仅需一到四步即可实现高分辨率媒体生成。

Link to this section潜空间一致性模型的机制#

LCMs build upon the foundational concept of Consistency Models introduced by researchers at OpenAI, which aim to map any point on a noisy data trajectory directly back to its clean origin. Instead of applying this technique in the high-dimensional pixel space, LCMs apply it within the latent space of pre-trained Latent Diffusion Models (LDMs).

通过称为一致性蒸馏的过程,预训练的 基础模型 被微调以强制执行一致性损失。这训练神经网络输出相同的干净潜空间表示,无论最初添加了多少噪声。结果是一个绕过标准扩散的顺序 马尔可夫决策过程 的模型,转化为标准硬件上的近乎实时的渲染能力。

Link to this section实际应用#

LCMs 的极致速度开启了以前因延迟限制而无法实现的全新交互可能性:

  • 实时交互设计: 在图形设计和 建筑计算机视觉 领域,LCMs 为实时画布应用提供支持,用户勾勒简单的轮廓,AI 在用户绘制时瞬时渲染出照片级逼真的景观或室内设计。
  • Dynamic Gaming Environments: Video game developers use fast latent generation to create dynamic, endlessly varying textures and background assets on the fly, seamlessly integrating with high-speed object detection systems like Ultralytics YOLO26 to respond to player movements without frame drops.

Link to this section区分 LCMs 与相关术语#

为了更好地理解 深度学习 的格局,将 LCMs 与类似架构进行对比会很有帮助:

  • LCMs 与扩散模型: 标准 扩散模型 需要 20 到 50 次迭代网络传递才能生成图像。LCMs 蒸馏了这个过程,在 1 到 4 次传递中实现了相当的质量。
  • LCMs 与一致性模型: 虽然标准一致性模型直接在原始图像像素上运行,但 LCMs 在压缩的特征表示(潜变量)上运行,这使它们的速度显著更快且内存占用更少。

Link to this section模拟快速潜空间处理#

在构建快速 机器学习 流水线时,高效管理潜空间张量是关键。以下 PyTorch 示例展示了 LCM 在理论上如何通过单次前向传播处理批处理的潜空间噪声张量,这一工作流程通常与 Ultralytics Platform 中管理的工具相结合。

import torch
import torch.nn as nn


# Simulate a simplified Latent Consistency Model block
class DummyLCM(nn.Module):
    def __init__(self):
        super().__init__()
        # In practice, this is a complex U-Net or Transformer architecture
        self.network = nn.Linear(64, 64)

    def forward(self, noisy_latent):
        # A single step predicts the clean latent directly
        return self.network(noisy_latent)


# Generate a random latent noise tensor (Batch Size 1, Channels 4, 16x16)
noise = torch.randn(1, 4, 16, 16).view(1, -1)
model = DummyLCM()

# Generate the denoised latent in just one step
clean_latent = model(noise)
print(f"Output shape: {clean_latent.shape}")

随着 人工智能 领域的发展,向更少生成步骤的转变对 边缘计算 和移动端部署产生了重大影响。通过降低计算开销,LCMs 补充了快速感知模型,为实现全自动、实时的创意和分析 AI 系统铺平了道路。

Explore solutions

Real-time AI that works with your team

机器人技术中的 AI

使用 Ultralytics YOLO 模型为智能机器赋能。机器人技术中的视觉 AI 可推动自主导航、感知、物体跟踪和实时控制。
了解更多
Real-time AI that works with your team

物流中的 AI

使用 Ultralytics YOLO 模型简化物流。视觉 AI 可实现包裹检查、分拣、车辆跟踪和实时仓库安全监控。
了解更多
Real-time AI that works with your team

零售业 AI

使用 Ultralytics YOLO 模型重塑零售业。视觉 AI 推动库存跟踪、货架监控、队列管理和更智能的客户洞察。
了解更多
Real-time AI that works with your team

医疗保健中的 AI

利用 Ultralytics YOLO 模型构建医疗保健解决方案。医疗保健中的视觉 AI 可助力更快速的医学影像分析、更智能的诊断和患者监测。
了解更多
Real-time AI that works with your team

制造业中的 AI

使用 Ultralytics YOLO 模型优化制造业。视觉 AI 推动质量控制、缺陷检测、PPE 合规性和装配线自动化。
了解更多
Real-time AI that works with your operation

汽车中的 AI

将计算机视觉应用于汽车行业,并配合 Ultralytics YOLO 模型。汽车视觉 AI 可提升道路安全、辅助驾驶和车辆自动化,打造更智能的道路。
了解更多
Real-time AI tailored to your operation

农业中的 AI

借助 Ultralytics YOLO 模型,将视觉 AI 引入智慧农业。赋能作物监测、牲畜追踪和精准农业,实现更高、更智能的产量。
了解更多
Real-time AI that works with your team

机器人技术中的 AI

使用 Ultralytics YOLO 模型为智能机器赋能。机器人技术中的视觉 AI 可推动自主导航、感知、物体跟踪和实时控制。
了解更多
Real-time AI that works with your team

物流中的 AI

使用 Ultralytics YOLO 模型简化物流。视觉 AI 可实现包裹检查、分拣、车辆跟踪和实时仓库安全监控。
了解更多
Real-time AI that works with your team

零售业 AI

使用 Ultralytics YOLO 模型重塑零售业。视觉 AI 推动库存跟踪、货架监控、队列管理和更智能的客户洞察。
了解更多
Real-time AI that works with your team

医疗保健中的 AI

利用 Ultralytics YOLO 模型构建医疗保健解决方案。医疗保健中的视觉 AI 可助力更快速的医学影像分析、更智能的诊断和患者监测。
了解更多
Real-time AI that works with your team

制造业中的 AI

使用 Ultralytics YOLO 模型优化制造业。视觉 AI 推动质量控制、缺陷检测、PPE 合规性和装配线自动化。
了解更多
Real-time AI that works with your operation

汽车中的 AI

将计算机视觉应用于汽车行业,并配合 Ultralytics YOLO 模型。汽车视觉 AI 可提升道路安全、辅助驾驶和车辆自动化,打造更智能的道路。
了解更多
Real-time AI tailored to your operation

农业中的 AI

借助 Ultralytics YOLO 模型,将视觉 AI 引入智慧农业。赋能作物监测、牲畜追踪和精准农业,实现更高、更智能的产量。
了解更多
Real-time AI that works with your team

机器人技术中的 AI

使用 Ultralytics YOLO 模型为智能机器赋能。机器人技术中的视觉 AI 可推动自主导航、感知、物体跟踪和实时控制。
了解更多
Real-time AI that works with your team

物流中的 AI

使用 Ultralytics YOLO 模型简化物流。视觉 AI 可实现包裹检查、分拣、车辆跟踪和实时仓库安全监控。
了解更多
Real-time AI that works with your team

零售业 AI

使用 Ultralytics YOLO 模型重塑零售业。视觉 AI 推动库存跟踪、货架监控、队列管理和更智能的客户洞察。
了解更多
Real-time AI that works with your team

医疗保健中的 AI

利用 Ultralytics YOLO 模型构建医疗保健解决方案。医疗保健中的视觉 AI 可助力更快速的医学影像分析、更智能的诊断和患者监测。
了解更多
Real-time AI that works with your team

制造业中的 AI

使用 Ultralytics YOLO 模型优化制造业。视觉 AI 推动质量控制、缺陷检测、PPE 合规性和装配线自动化。
了解更多
Real-time AI that works with your operation

汽车中的 AI

将计算机视觉应用于汽车行业,并配合 Ultralytics YOLO 模型。汽车视觉 AI 可提升道路安全、辅助驾驶和车辆自动化,打造更智能的道路。
了解更多
Real-time AI tailored to your operation

农业中的 AI

借助 Ultralytics YOLO 模型,将视觉 AI 引入智慧农业。赋能作物监测、牲畜追踪和精准农业,实现更高、更智能的产量。
了解更多

让我们一起构建 AI 的未来!

开启你的机器学习未来之旅