Skip to content

CLIPTextEncodeFlux is not exist #6

Description

@JrTango

CLIPTextEncodeFlux is not exist

workflow_service.py

    def update_workflow_prompt(self, workflow: Dict[str, Any], prompt: str, negative_prompt: str = '') -> Dict[str, Any]:
        """更新工作流中的提示词。"""
        for node in workflow.values():
            if node.get('class_type') == 'CLIPTextEncodeFlux':
                title = str.lower(node['_meta'].get('title', ''))
                if 'negative' in title:
                    if negative_prompt:
                        node['inputs']['clip_l'] = negative_prompt
                        node['inputs']['t5xxl'] = negative_prompt
                else:
                    node['inputs']['clip_l'] = prompt
                    node['inputs']['t5xxl'] = prompt
            elif node.get('class_type') == 'CLIPTextEncode':
                title = str.lower(node['_meta'].get('title', ''))
                if 'negative' in title:
                    if negative_prompt:
                        node['inputs']['text'] = negative_prompt
                else:
                    node['inputs']['text'] = prompt
            # 新增对nunchaku-flux.1-dev.json中使用的CLIPTextEncode节点的处理
            elif node.get('class_type') == 'CLIPTextEncode':
                title = str.lower(node['_meta'].get('title', ''))
                if 'negative' in title:
                    node['inputs']['text'] = negative_prompt if negative_prompt else ""
                else:
                    node['inputs']['text'] = prompt
        return workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions