【深度学习】sdxl中的 text_encoder text_encoder_2 区别

镜像问题是:https://editor.csdn.net/md/?articleId=135867689

代码仓库:

https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/tree/main

截图:

为什么有两个CLIP编码器 text_encoder text_encoder_2

在仔细阅读这些代码后,我们了解到 text_encoder_2 主要是用于 refiner 模型的。

bash 复制代码
        if 'clip' in self.stages:
            subfolder = 'text_encoder'
            self.models['clip'] = CLIPModel(**models_args, embedding_dim=get_clip_embedding_dim(self.version, self.pipeline_type), output_hidden_states=self.config.get('clip_hidden_states', False), subfolder=subfolder)

        if 'clip2' in self.stages:
            subfolder = 'text_encoder_2'
            self.models['clip2'] = CLIPWithProjModel(**models_args, output_hidden_states=self.config.get('clip_hidden_states', False), subfolder=subfolder)
相关推荐
小程故事多_807 小时前
破解Agent“半途摆烂”困局,OpenDev凭Harness架构,撕开Code Agents的工程化真相
人工智能·架构·aigc·harness
吴佳浩7 小时前
Vibe Coding 时代:Vue 消失了还是 React 太强?
人工智能
Elastic 中国社区官方博客7 小时前
Elasticsearch:如何在 Elastic AI Builder 里使用 DSL 来查询 Elasticsearch
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索
musicml7 小时前
从 Vibe Coding 到 SDD(规范驱动开发):AI 原生时代的软件工程化实践
人工智能·驱动开发·软件工程
Deepoch7 小时前
Deepoc具身模型:重塑无人机无遥控器作业
人工智能·科技·无人机·具身模型·deepoc
i建模7 小时前
Claude Code在编程之外的能力
人工智能
言之。7 小时前
用Claude Code搞定产品上线
人工智能
HIT_Weston7 小时前
31、【Agent】【OpenCode】模型配置(OpenRouter&OpenCode)
人工智能·agent·opencode
Coder个人博客7 小时前
06_apollo_third_party子模块整体软件架构深入分析文档
linux·人工智能·架构
uzong7 小时前
ClaudeCode 入门详细教程,手把手带你Vibe Coding
前端·人工智能