首页 > 其他分享 >Datawhale X 魔搭 AI夏令营(三)

Datawhale X 魔搭 AI夏令营(三)

时间:2024-08-17 10:15:25浏览次数:12  
标签:name AI Datawhale 夏令营 mode order type id size

一.初识ComfyUI

1.ComfyUI 是GUI的一种,是基于节点工作的用户界面,主要用于操作图像的生成技术,ComfyUI 的特别之处在于它采用了一种模块化的设计,把图像生成的过程分解成了许多小的步骤,每个步骤都是一个节点。这些节点可以连接起来形成一个工作流程,这样用户就可以根据需要定制自己的图像生成过程

2.详细教程见魔搭教程https://www.yuque.com/office/yuque/0/2024/pptx/1169882/1720432237458-e4b10804-b9cb-401d-aa2c-6de04b5276e0.pptx?from=https%3A%2F%2Fwww.yuque.com%2F2ai%2Fmodel%2Fgutsk9ezeymuebq9

二.开始实践

1.下载安装ComfyUI的执行文件和task1中(见Datawhale X 魔搭 AI夏令营(一))微调完成Lora文件
git lfs install git clone https://www.modelscope.cn/datasets/maochase/kolors_test_comfyui.git mv kolors_test_comfyui/* ./ rm -rf kolors_test_comfyui/ mkdir -p /mnt/workspace/models/lightning_logs/version_0/checkpoints/ mv epoch=0-step=500.ckpt /mnt/workspace/models/lightning_logs/version_0/checkpoints/

2.一键执行安装程序

3.当执行到最后一个节点的内容输出了一个访问的链接的时候,复制链接到浏览器中访问
https://datawhaler.feishu.cn/a43cb6f3-f7c6-4c25-a672-f8d42267705a

三.浅尝ComfyUI工作流

1.不带Lora的工作流样例(先下载工作流脚本kolors_example.json)

点击查看代码
      
{
  "last_node_id": 15,
  "last_link_id": 18,
  "nodes": [
    {
      "id": 11,
      "type": "VAELoader",
      "pos": [
        1323,
        240
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 0,
      "mode": 0,
      "outputs": [
        {
          "name": "VAE",
          "type": "VAE",
          "links": [
            12
          ],
          "shape": 3
        }
      ],
      "properties": {
        "Node name for S&R": "VAELoader"
      },
      "widgets_values": [
        "sdxl.vae.safetensors"
      ]
    },
    {
      "id": 10,
      "type": "VAEDecode",
      "pos": [
        1368,
        369
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 6,
      "mode": 0,
      "inputs": [
        {
          "name": "samples",
          "type": "LATENT",
          "link": 18
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 12,
          "slot_index": 1
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            13
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEDecode"
      }
    },
    {
      "id": 14,
      "type": "KolorsSampler",
      "pos": [
        1011,
        371
      ],
      "size": {
        "0": 315,
        "1": 222
      },
      "flags": {},
      "order": 5,
      "mode": 0,
      "inputs": [
        {
          "name": "kolors_model",
          "type": "KOLORSMODEL",
          "link": 16
        },
        {
          "name": "kolors_embeds",
          "type": "KOLORS_EMBEDS",
          "link": 17
        }
      ],
      "outputs": [
        {
          "name": "latent",
          "type": "LATENT",
          "links": [
            18
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "KolorsSampler"
      },
      "widgets_values": [
        1024,
        1024,
        1000102404233412,
        "fixed",
        25,
        5,
        "EulerDiscreteScheduler"
      ]
    },
    {
      "id": 6,
      "type": "DownloadAndLoadKolorsModel",
      "pos": [
        201,
        368
      ],
      "size": {
        "0": 315,
        "1": 82
      },
      "flags": {},
      "order": 1,
      "mode": 0,
      "outputs": [
        {
          "name": "kolors_model",
          "type": "KOLORSMODEL",
          "links": [
            16
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "DownloadAndLoadKolorsModel"
      },
      "widgets_values": [
        "Kwai-Kolors/Kolors",
        "fp16"
      ]
    },
    {
      "id": 3,
      "type": "PreviewImage",
      "pos": [
        1366,
        468
      ],
      "size": [
        535.4001724243165,
        562.2001106262207
      ],
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 13
        }
      ],
      "properties": {
        "Node name for S&R": "PreviewImage"
      }
    },
    {
      "id": 12,
      "type": "KolorsTextEncode",
      "pos": [
        519,
        529
      ],
      "size": [
        457.2893696934723,
        225.28656056301645
      ],
      "flags": {},
      "order": 4,
      "mode": 0,
      "inputs": [
        {
          "name": "chatglm3_model",
          "type": "CHATGLM3MODEL",
          "link": 14,
          "slot_index": 0
        }
      ],
      "outputs": [
        {
          "name": "kolors_embeds",
          "type": "KOLORS_EMBEDS",
          "links": [
            17
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "KolorsTextEncode"
      },
      "widgets_values": [
        "cinematic photograph of an astronaut riding a horse in space |\nillustration of a cat wearing a top hat and a scarf  |\nphotograph of a goldfish in a bowl |\nanime screencap of a red haired girl",
        "",
        1
      ]
    },
    {
      "id": 15,
      "type": "Note",
      "pos": [
        200,
        636
      ],
      "size": [
        273.5273818969726,
        149.55464588512064
      ],
      "flags": {},
      "order": 2,
      "mode": 0,
      "properties": {
        "text": ""
      },
      "widgets_values": [
        "Text encoding takes the most VRAM, quantization can reduce that a lot.\n\nApproximate values I have observed:\nfp16 - 12 GB\nquant8 - 8-9 GB\nquant4 - 4-5 GB\n\nquant4 reduces the quality quite a bit, 8 seems fine"
      ],
      "color": "#432",
      "bgcolor": "#653"
    },
    {
      "id": 13,
      "type": "DownloadAndLoadChatGLM3",
      "pos": [
        206,
        522
      ],
      "size": [
        274.5334274291992,
        58
      ],
      "flags": {},
      "order": 3,
      "mode": 0,
      "outputs": [
        {
          "name": "chatglm3_model",
          "type": "CHATGLM3MODEL",
          "links": [
            14
          ],
          "shape": 3
        }
      ],
      "properties": {
        "Node name for S&R": "DownloadAndLoadChatGLM3"
      },
      "widgets_values": [
        "fp16"
      ]
    }
  ],
  "links": [
    [
      12,
      11,
      0,
      10,
      1,
      "VAE"
    ],
    [
      13,
      10,
      0,
      3,
      0,
      "IMAGE"
    ],
    [
      14,
      13,
      0,
      12,
      0,
      "CHATGLM3MODEL"
    ],
    [
      16,
      6,
      0,
      14,
      0,
      "KOLORSMODEL"
    ],
    [
      17,
      12,
      0,
      14,
      1,
      "KOLORS_EMBEDS"
    ],
    [
      18,
      14,
      0,
      10,
      0,
      "LATENT"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {
    "ds": {
      "scale": 1.1,
      "offset": {
        "0": -114.73954010009766,
        "1": -139.79705810546875
      }
    }
  },
  "version": 0.4
}

    

2.完成第一次生图

https://datawhaler.feishu.cn/81fb40e4-afc1-4d11-a96c-6046022f6827

https://datawhaler.feishu.cn/ee94d6c3-c013-4f3b-be47-617d8658a93d

  1. 带Lora的工作流样例(工作流脚本kolors_with_lora_example.json)
点击查看代码
      
{
  "last_node_id": 16,
  "last_link_id": 20,
  "nodes": [
    {
      "id": 11,
      "type": "VAELoader",
      "pos": [
        1323,
        240
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 0,
      "mode": 0,
      "outputs": [
        {
          "name": "VAE",
          "type": "VAE",
          "links": [
            12
          ],
          "shape": 3
        }
      ],
      "properties": {
        "Node name for S&R": "VAELoader"
      },
      "widgets_values": [
        "sdxl.vae.safetensors"
      ]
    },
    {
      "id": 10,
      "type": "VAEDecode",
      "pos": [
        1368,
        369
      ],
      "size": {
        "0": 210,
        "1": 46
      },
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "name": "samples",
          "type": "LATENT",
          "link": 18
        },
        {
          "name": "vae",
          "type": "VAE",
          "link": 12,
          "slot_index": 1
        }
      ],
      "outputs": [
        {
          "name": "IMAGE",
          "type": "IMAGE",
          "links": [
            13
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "VAEDecode"
      }
    },
    {
      "id": 15,
      "type": "Note",
      "pos": [
        200,
        636
      ],
      "size": {
        "0": 273.5273742675781,
        "1": 149.5546417236328
      },
      "flags": {},
      "order": 1,
      "mode": 0,
      "properties": {
        "text": ""
      },
      "widgets_values": [
        "Text encoding takes the most VRAM, quantization can reduce that a lot.\n\nApproximate values I have observed:\nfp16 - 12 GB\nquant8 - 8-9 GB\nquant4 - 4-5 GB\n\nquant4 reduces the quality quite a bit, 8 seems fine"
      ],
      "color": "#432",
      "bgcolor": "#653"
    },
    {
      "id": 13,
      "type": "DownloadAndLoadChatGLM3",
      "pos": [
        206,
        522
      ],
      "size": {
        "0": 274.5334167480469,
        "1": 58
      },
      "flags": {},
      "order": 2,
      "mode": 0,
      "outputs": [
        {
          "name": "chatglm3_model",
          "type": "CHATGLM3MODEL",
          "links": [
            14
          ],
          "shape": 3
        }
      ],
      "properties": {
        "Node name for S&R": "DownloadAndLoadChatGLM3"
      },
      "widgets_values": [
        "fp16"
      ]
    },
    {
      "id": 6,
      "type": "DownloadAndLoadKolorsModel",
      "pos": [
        201,
        368
      ],
      "size": {
        "0": 315,
        "1": 82
      },
      "flags": {},
      "order": 3,
      "mode": 0,
      "outputs": [
        {
          "name": "kolors_model",
          "type": "KOLORSMODEL",
          "links": [
            19
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "DownloadAndLoadKolorsModel"
      },
      "widgets_values": [
        "Kwai-Kolors/Kolors",
        "fp16"
      ]
    },
    {
      "id": 12,
      "type": "KolorsTextEncode",
      "pos": [
        519,
        529
      ],
      "size": {
        "0": 457.28936767578125,
        "1": 225.28656005859375
      },
      "flags": {},
      "order": 4,
      "mode": 0,
      "inputs": [
        {
          "name": "chatglm3_model",
          "type": "CHATGLM3MODEL",
          "link": 14,
          "slot_index": 0
        }
      ],
      "outputs": [
        {
          "name": "kolors_embeds",
          "type": "KOLORS_EMBEDS",
          "links": [
            17
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "KolorsTextEncode"
      },
      "widgets_values": [
        "二次元,长发,少女,白色背景",
        "",
        1
      ]
    },
    {
      "id": 3,
      "type": "PreviewImage",
      "pos": [
        1366,
        469
      ],
      "size": {
        "0": 535.400146484375,
        "1": 562.2001342773438
      },
      "flags": {},
      "order": 8,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 13
        }
      ],
      "properties": {
        "Node name for S&R": "PreviewImage"
      }
    },
    {
      "id": 16,
      "type": "LoadKolorsLoRA",
      "pos": [
        606,
        368
      ],
      "size": {
        "0": 317.4000244140625,
        "1": 82
      },
      "flags": {},
      "order": 5,
      "mode": 0,
      "inputs": [
        {
          "name": "kolors_model",
          "type": "KOLORSMODEL",
          "link": 19
        }
      ],
      "outputs": [
        {
          "name": "kolors_model",
          "type": "KOLORSMODEL",
          "links": [
            20
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "LoadKolorsLoRA"
      },
      "widgets_values": [
        "/mnt/workspace/models/lightning_logs/version_0/checkpoints/epoch=0-step=500.ckpt",
        2
      ]
    },
    {
      "id": 14,
      "type": "KolorsSampler",
      "pos": [
        1011,
        371
      ],
      "size": {
        "0": 315,
        "1": 266
      },
      "flags": {},
      "order": 6,
      "mode": 0,
      "inputs": [
        {
          "name": "kolors_model",
          "type": "KOLORSMODEL",
          "link": 20
        },
        {
          "name": "kolors_embeds",
          "type": "KOLORS_EMBEDS",
          "link": 17
        },
        {
          "name": "latent",
          "type": "LATENT",
          "link": null
        }
      ],
      "outputs": [
        {
          "name": "latent",
          "type": "LATENT",
          "links": [
            18
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "KolorsSampler"
      },
      "widgets_values": [
        1024,
        1024,
        0,
        "fixed",
        25,
        5,
        "EulerDiscreteScheduler",
        1
      ]
    }
  ],
  "links": [
    [
      12,
      11,
      0,
      10,
      1,
      "VAE"
    ],
    [
      13,
      10,
      0,
      3,
      0,
      "IMAGE"
    ],
    [
      14,
      13,
      0,
      12,
      0,
      "CHATGLM3MODEL"
    ],
    [
      17,
      12,
      0,
      14,
      1,
      "KOLORS_EMBEDS"
    ],
    [
      18,
      14,
      0,
      10,
      0,
      "LATENT"
    ],
    [
      19,
      6,
      0,
      16,
      0,
      "KOLORSMODEL"
    ],
    [
      20,
      16,
      0,
      14,
      0,
      "KOLORSMODEL"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {
    "ds": {
      "scale": 1.2100000000000002,
      "offset": {
        "0": -183.91309381910426,
        "1": -202.11110769225016
      }
    }
  },
  "version": 0.4
}

    

4.生图步骤同上

四.Lora详解https://www.bilibili.com/video/BV1nT421k7Fa/?t=28.133192&spm_id_from=333.1350.jump_directly&vd_source=87de892b60ecaebe6b8575e21f4aa997

五.准备一个高质量的数据集

当我们进行图片生成相关的工作时,选择合适的数据集是非常重要的。如何找到适合自己的数据集呢,这里给大家整理了一些重要的参考维度,希望可以帮助你快速找到适合的数据集:

1.明确你的需求和目标

a.关注应用场景**:确定你的模型将被应用到什么样的场景中(例如,艺术风格转换、产品图像生成、医疗影像合成等)。

b.关注数据类型**:你需要什么样的图片?比如是真实世界的照片还是合成图像?是黑白的还是彩色的?是高分辨率还是低分辨率?

c.关注数据量**:考虑你的任务应该需要多少图片来支持训练和验证。

2.数据集来源整理

以下渠道来源均需要考虑合规性问题,请大家在使用数据集过程中谨慎选择

标签:name,AI,Datawhale,夏令营,mode,order,type,id,size
From: https://www.cnblogs.com/CuckooAI/p/18364097

相关文章

  • 非结构化数据解析 &GenAI的应用探索和实践(文字稿)
    以下内容是8.15日我在上海张江科学会堂举办的“GOTC(全球开源技术峰会)”与“GOGC(全球开源极客嘉年华)”分享内容文字稿,分享给大家。一、前言大家下午好,我叫肖玉民,来自杭州萌嘉网络科技有限公司,很荣幸受主办方的邀请,来参加此次GOTC2024的分享。我们是一家刚成立不久的初创公......
  • 给 RAID5 添加热备盘
    给RAID5添加热备盘创建RAID5时设置1块热备盘;[root@zhpj~]#mdadm-Cv/dev/md5-n3-l5-x1/dev/sd{b..e}mdadm:layoutdefaultstoleft-symmetricmdadm:layoutdefaultstoleft-symmetricmdadm:chunksizedefaultsto512Kmdadm:sizesetto10476544Km......
  • 百度ai只能回答怎么关闭
      百度ai只能回答怎么关闭要关闭‌百度的AI智能回答功能,可以通过以下几种方法实现:使用广告拦截插件安装广告拦截插件:如‌AdGuard、‌uBlockOrigin等,这些插件可以帮助你拦截或隐藏百度的智能AI回答内容。配置插件规则:在插件的控制面板中,找到自定义静态规则处,输入......
  • AIGC新手炼丹师快速生成属于自己的lora--示范样例:北条时行(出自:擅长逃跑的殿下)
    目录一.准备工作:安装stable-diffusion和sd-trainer二.准备数据集2.1确定你想要的数据集2.2准备数据集2.2.1对于人物类的数据集2.2.2数据集的处理2.2.3数据集所在文件夹参考位置(出于方便考虑,仅供参考):2.2.4由数据集生成标签                  2.2.5......
  • Datawhale X 魔搭 AI0夏令营 魔搭-AIGC文生图方向 Tsak 3 就要完成了...
    本文为AI方向小白记录暑期参加魔搭夏令营-AIGC文生图方向的Task01    报名赛事链接:可图Kolors-LoRA风格故事挑战赛_创新应用大赛_天池大赛-阿里云天池的赛制    欢迎所有小白,大神前来交流学习。一.初识ComfyUI    1.1什么是ComfyUI      ......
  • Datawhale X 魔搭 AI0夏令营 魔搭-AIGC文生图方向 Tsak 1
    本文为AI方向小白记录暑期参加魔搭夏令营-AIGC文生图方向的Task01    报名赛事链接:https://tianchi.aliyun.com/competition/entrance/532254    欢迎所有小白,大神前来交流学习。一.文生图相关基础知识介绍    1.1文生图的介绍        文......
  • 一次性搞懂什么是AIGC(附专业术语)
    在这个日新月异的数字时代,AI(人工智能)已经不再是一个遥不可及的词汇,而是深入我们生活的方方面面。其中,AIGC(人工智能生成内容)作为AI技术的一个重要分支,正逐渐改变着内容创作的格局。今天,我们就来一次性搞懂AIGC,从基本概念到常用应用,再到一款实用的辅助工具——HelpLook。一、......
  • 最新AI生成视频工具!效果不输快手可灵,CogVideoX下载介绍
    要说AI生成视频最火的项目,当属国产的快手可灵了,甚至比OpenAI的Sora还要火,前者还是个ppt,可灵已经在落地公测了,博主在前段时间申请试用通道的时候,竟然排到几十万人开外的位置,好在最后还是拿到了使用资格,还没用上的外国友人只能干着急,在社交媒体发「求求了!」但就在最近,可灵开始......
  • 最新AI生成视频工具!效果不输快手可灵,CogVideoX下载介绍
    要说AI生成视频最火的项目,当属国产的快手可灵了,甚至比OpenAI的Sora还要火,前者还是个ppt,可灵已经在落地公测了,博主在前段时间申请试用通道的时候,竟然排到几十万人开外的位置,好在最后还是拿到了使用资格,还没用上的外国友人只能干着急,在社交媒体发「求求了!」 但就在最近,可灵开始......
  • failed to solve: process “/bin/sh -c yum -y install vim“ did not complete succ
    网上有好多种方法(都试过了只有方法四可以用):方法一:systemctl restart  docker(生产上不建议)方法二:看看你的网络是否有问题,检查一下网络连通性方法三:有可能是容器版本的问题,推荐使用centos7,看网上说最新的镜像会有这类的的问题方法四:就像这个博主大佬说的修改主机源修改......