[AI Omost] 革命性AI图像合成技术,让你的创意几乎一触即发!

news2024/11/19 19:33:50

介绍

Omost 是一个创新的项目,它利用大型语言模型(LLM)的编码能力来生成图像,特别是通过图像合成技术。项目的名称“Omost”发音类似于“almost”,寓意着使用该项目后,用户的图像生成工作几乎可以完成。同时,“O”代表“omni”(多模态),而“most”则表示项目旨在最大化模型的潜力。

Omost 提供了一些LLM模型,这些模型能够编写代码,并与Omost的虚拟画布代理协作,合成图像的视觉内容。这个虚拟画布能够与特定的图像生成器结合,以实际生成图像。

目前,Omost 提供了3个基于Llama3和Phi3变种的预训练LLM模型。这些模型使用混合数据进行训练,包括:

  1. 几个数据集的真实标注数据,如Open-Images。
  2. 通过自动标注图像提取的数据。
  3. 来自DPO(直接偏好优化)的强化,其中代码是否能被Python 3.10编译作为直接偏好。
  4. 来自OpenAI GPT4o的多模态能力的一小部分调整数据。

通过这些训练数据,Omost 的模型能够生成高质量的图像,为用户提供一个强大的图像合成工具。

安装

安装很简单,只需运行以下命令:

git clone https://github.com/lllyasviel/Omost.git
cd Omost
conda create -n omost python=3.10
conda activate omost
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
python gradio_app.py

原理

原理请看github上的readme(文末有链接),已经说的很清楚了。

简单说就是:说一句简单的 prompt,LLM帮你丰富,详细规划图像,最后生成高质量可控图像。

实践

纸上得来终觉浅,绝知此事要躬行。实际操作一把:

界面还是比较清楚。

右边输入 prompt,点击“submit”。

然后界面就会生成一大片详细设计描述。

生成完成,点击左边的“Render the Image!”。稍等片刻,图片生成!

script

我们来看下生成的脚本。

我输入的是“Happy Children’s Day”,下面生成了一大堆图像设计描述。

# Initialize the canvas
canvas = Canvas()

# Set a global description for the canvas
canvas.set_global_description(
    description="A joyful celebration of Children's Day.",
    detailed_descriptions=[
        'The image captures a lively and joyful celebration of Children’s Day.',
        'In the center, a group of happy children are playing together, laughing and having a great time.',
        'They are dressed in colorful, festive outfits and are surrounded by balloons and streamers.',
        'On the left, a clown is entertaining the children with tricks and jokes, adding to the festive atmosphere.',
        'On the right, a table filled with delicious treats and toys is attracting the attention of the children.',
        'On the top, a large banner that reads "Happy Children’s Day" is displayed, accompanied by colorful decorations.',
        'On the bottom, a group of parents and caregivers are smiling and watching over the children, enjoying the joyous moment.',
        'The overall atmosphere is one of happiness, joy, and celebration, with bright colors and lively energy filling the scene.',
    ],
    tags="Children's Day, celebration, happiness, joy, children, playing, laughing, festive outfits, balloons, streamers, clown, tricks, jokes, treats, toys, banner, decorations, parents, caregivers, smiling, watching, bright colors, lively energy",
    HTML_web_color_name='lightgoldenrodyellow',
)

# Add a group of happy children playing together.
canvas.add_local_description(
    location='in the center',
    offset='no offset',
    area='a medium-sized square area',
    distance_to_viewer=2.0,
    description='A group of happy children playing together.',
    detailed_descriptions=[
        'In the center of the image, a group of happy children are playing together.',
        'They are dressed in colorful, festive outfits that include bright dresses, shirts, and shorts.',
        'The children are laughing and having a great time, their faces filled with joy and excitement.',
        'They are surrounded by balloons and streamers, adding to the festive atmosphere.',
        'The children are engaging in various activities such as running, chasing each other, and playing games.',
        'Their energy and happiness are infectious, creating a joyful and lively scene.',
    ],
    tags='children, playing, happy, colorful outfits, bright dresses, shirts, shorts, laughing, joy, excitement, balloons, streamers, running, chasing, playing games, energy, happiness',
    atmosphere='Joyful and lively, filled with energy and happiness.',
    style='Bright and colorful, with a focus on the happiness of the children.',
    quality_meta='High-quality, capturing the joyful moment with clarity and detail.',
    HTML_web_color_name='lightyellow',
)

# Add a clown entertaining the children.
canvas.add_local_description(
    location='on the left',
    offset='no offset',
    area='a medium-sized vertical area',
    distance_to_viewer=3.0,
    description='A clown entertaining the children.',
    detailed_descriptions=[
        'On the left side of the image, a clown is entertaining the children with tricks and jokes.',
        'The clown is wearing a bright red nose, oversized shoes, and a colorful costume with large buttons and stripes.',
        'He is performing tricks such as pulling out colorful objects from a hat and making silly jokes to make the children laugh.',
        'The children are clearly enjoying the clown’s performance, their faces lit up with joy and amusement.',
        'The clown’s antics add to the festive and joyful atmosphere of the celebration.',
    ],
    tags='clown, entertaining, tricks, jokes, bright red nose, oversized shoes, colorful costume, large buttons, stripes, performing tricks, pulling out objects, making jokes, children laughing, joy, amusement, festive, joyful atmosphere',
    atmosphere='Festive and joyful, filled with laughter and amusement.',
    style='Colorful and lively, with a focus on the entertainment provided by the clown.',
    quality_meta='High-quality, capturing the clown’s performance with clarity and detail.',
    HTML_web_color_name='tomato',
)

# Add a table filled with treats and toys.
canvas.add_local_description(
    location='on the right',
    offset='no offset',
    area='a medium-sized vertical area',
    distance_to_viewer=3.0,
    description='A table filled with treats and toys.',
    detailed_descriptions=[
        'On the right side of the image, a table is filled with a variety of delicious treats and colorful toys.',
        'The table is decorated with a red and white checkered cloth and is laden with goodies such as cupcakes, candies, and fruit.',
        'Next to the table, there are piles of toys including stuffed animals, building blocks, and small cars.',
        'The treats and toys are attracting the attention of the children, who are excitedly gathering around the table to explore and enjoy the offerings.',
        'The table adds to the festive and enjoyable atmosphere of the celebration.',
    ],
    tags='table, treats, toys, red and white checkered cloth, cupcakes, candies, fruit, stuffed animals, building blocks, small cars, attention of children, excited, exploring, enjoying, festive, enjoyable atmosphere',
    atmosphere='Festive and enjoyable, filled with excitement and joy.',
    style='Bright and colorful, with a focus on the variety of treats and toys.',
    quality_meta='High-quality, capturing the treats and toys with clarity and detail.',
    HTML_web_color_name='lightcoral',
)

# Add a large banner that reads "happy children's day".
canvas.add_local_description(
    location='on the top',
    offset='no offset',
    area='a large horizontal area',
    distance_to_viewer=5.0,
    description="A large banner that reads 'Happy Children's Day'.",
    detailed_descriptions=[
        "On the top of the image, a large banner that reads 'Happy Children's Day' is displayed.",
        'The banner is decorated with colorful ribbons and is placed against a backdrop of festive decorations.',
        'The text on the banner is large and bold, making it easily readable.',
        'The banner adds to the celebratory and joyful atmosphere of the scene, serving as a focal point that draws attention.',
        'The decorations surrounding the banner include streamers, balloons, and other festive elements that enhance the overall celebratory feel of the image.',
    ],
    tags="banner, Happy Children's Day, large, colorful ribbons, backdrop, festive decorations, text, bold, readable, celebratory, joyful atmosphere, focal point, streamers, balloons, festive elements, overall celebratory feel",
    atmosphere='Celebratory and joyful, with a focus on the festive decorations.',
    style='Colorful and festive, with a focus on the banner and decorations.',
    quality_meta='High-quality, capturing the banner and decorations with clarity and detail.',
    HTML_web_color_name='gold',
)

# Add parents and caregivers smiling and watching over the children.
canvas.add_local_description(
    location='on the bottom',
    offset='no offset',
    area='a large horizontal area',
    distance_to_viewer=4.0,
    description='Parents and caregivers smiling and watching over the children.',
    detailed_descriptions=[
        'On the bottom of the image, a group of parents and caregivers are smiling and watching over the children.',
        'They are dressed in casual and comfortable clothing, and their expressions are filled with joy and pride as they watch their children having fun.',
        'The parents and caregivers are standing and sitting, some holding cameras to capture the special moment.',
        'They are actively involved in the celebration, cheering and clapping along with the children.',
        'Their presence adds to the overall joyful and celebratory atmosphere, making the scene feel complete and heartwarming.',
    ],
    tags='parents, caregivers, smiling, watching, children, casual clothing, comfortable clothing, joy, pride, having fun, standing, sitting, holding cameras, capturing moment, actively involved, cheering, clapping, overall joyful atmosphere, celebratory, heartwarming',
    atmosphere='Joyful and celebratory, filled with pride and joy.',
    style='Heartwarming and joyful, with a focus on the parents and caregivers.',
    quality_meta='High-quality, capturing the expressions and actions of the parents and caregivers with clarity and detail.',
    HTML_web_color_name='lightpink',
)

最后生成了图像。效果还不错。

样例

最后给大家看几张我生成的图,效果都还不错。

问题就是有点慢,几分钟一张图。


  • github
  • AI 博客 - 从零开始学AI
  • 公众号 - 从零开始学AI

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1811491.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

超详解——python函数定义和调用——小白篇

目录 1. 函数的参数 位置参数: 关键字参数: 默认参数: 2. 关键字参数 3. 参数组 4. 函数重载 5. 函数的返回值 单个返回值: 多个返回值: 6. 函数的内置属性 __name__: __doc__: 7…

重温react-02

shopdemo import React, { Component } from react export default class shopDemo extends Component {state {goods: [{id: 1,name: 商品1,price: 100,number: 0,money: 0},{id: 2,name: 商品2,price: 200,number: 0,money: 0},{id: 3,name: 商品3,price: 300,number: 0,mo…

如何解决 Git 默认不区分文件名大小写和同名文件共存?

修改文件命名的大小写,不会有 git 记录 本文章的例子:将 demo.vue 文件命名改为 Demo.vue 1、在Git项目路径下执行该命令 git config core.ignorecase false (1)以上方法可以实现 git 区分 demo.vue 与 Demo.vue 文件&#xff0…

【投稿优惠|权威主办】2024年物联网、土木建筑与城市工程国际学术会议(ICITCEUE 2024)

2024年物联网、土木建筑与城市工程国际学术会议(ICITCEUE 2024) 2024 International Academic Conference on the Internet of Things, Civil Engineering and Urban Engineering(ICITCEUE 2024) ▶会议简介 2024年物联网、土木建…

【解读】核密度图

def:what 核密度估计(Kernel Density Estimation,简称KDE)是一种用来估计随机变量概率密度函数的非参数方法 实现:(库函数)how import seaborn as sns import matplotlib.pyplot as plt# 使用…

开源完全自动化的桌上足球机器人Foosbar;自动编写和修复代码的AI小工具;开源工具,可本地运行,作为Perplexity AI的替代方案

✨ 1: Foosbar Foosbar是一款完全自动化的桌上足球机器人,能与人类玩家对战,具备防守、传球和射门能力。 Foosbar是一个完全自动化的桌上足球机器人,它实现了一侧由机器人控制,另一侧由人类玩家对战的游戏模式。这个机器人能够自…

2024下半年软考高级没有高项,考哪门最容易上岸?

2024上半年软考考试已经结束,有不少小伙伴已经开始准备下半年软考了,但是大家要注意:今年高项仅考上半年一次,下半年考的高级科目只有这四个(系分、架构、网规、系规)! 一、那么这种情况下&…

go语音进阶 多任务

多任务 什么叫 多任务?简单说:就像是操作系统可以同时执行 多个任务。打个比方 你一边使用 浏览器上网,一遍在听MP3, 一边再用 word 赶作业。对于电脑来讲这就是多任务,还有很多任务悄悄的在后台同时运行着,只是桌面上…

npm 添加 electron 安装镜像变量,提交打包速度。

前言:项目中使用 electron-builder,打包运行 npm run build:win 时, electron-builder 默认会从 github 下载 electron 依赖包,导致打包缓慢。可以通过添加 electron 下载镜像地址来解决。 npm config ls -l 查看 npm 所有配置 …

SmartEDA:革新教育电路,点亮学生创新之光!

在当今快速发展的科技时代,电路设计与电子技术的融合已成为教育领域不可或缺的一部分。而SmartEDA作为一款新兴的电路设计工具,正以其独特的优势助力学生创新实践,引领教育界迈向更加智能化的未来。 SmartEDA不仅具备传统电路设计软件的基本…

Redis(十六) 集群

文章目录 前言什么是集群集群模式基本原理哈希求余一致性哈希算法哈希槽分区算法 docker模拟出一个集群集群中节点挂了会怎么办故障判定故障迁移 集群扩容 前言 前面我们学习了 redis 哨兵机制,哨兵机制是为了解决当主节点挂了之后,能够自动进行故障转移…

JVM对象分配和垃圾回收机制

一、对象创建 1.1 符号引用 new 创建一个对象,需要在JVM创建对象。 符号引用:目标对象采用一个符号表示,类A加载的时候,如果成员变量类B还没有被加载进来,采用一个符号(字面量)来表示&#x…

Linux C语言:指针的运算

一、指针的算术运算 1、指针运算 指针运算是以指针所存放的地址作为运算量而进行的指针运算的实质就是地址的计算 2、指针的算数运算 指针加上整数,指针减去整数, 指针递增,指针递减和两个指针相减。 指针加减一个n的运算: px n px - n 移动步长…

LeetCode | 2879.显示前三行

在 pandas 中,可以使用 head() 方法来读取 DataFrame 的前几行数据。如果想读取指定数量的行,可以在 head() 方法中传入一个参数 n,读取前 n 行 import pandas as pddef selectFirstRows(employees: pd.DataFrame) -> pd.DataFrame:retur…

mybatisplus(原理)使用方法引用的形式获取实体类对应数据库的列名

我们现在正常来看 一个mybatisplus正常的查询语句 我们可以看到 ,再如上的代码中 我们使用了 Address::getuserId 方法引用,但是我们把方法引用改成lambda表达式的形式的时候不会报错,但是运行的时候报错。为什么…

Tkinter 组件详解之Entry

Tkinter 组件详解之Entry Entry(输入框)组件通常用于获取用户的输入文本。 何时使用 Entry 组件? Entry 组件仅允许用于输入一行文本,如果用于输入的字符串长度比该组件可显示空间更长,那内容将被滚动。这意味着该字符串将不能被全部看到(你可以用鼠标或键盘的方向键调…

[2024-06]-[大模型]-[DEBUG]- ollama webui 11434 connection refused

报错:host.docker.internal:11434 ssl:default [Connection refused] 将/etc/systemd/system/ollama.service中加上如下红框两行 Environment"OLLAMA_HOST0.0.0.0" Environment"OLLAMA_ORIGINS*"然后 systemctl daemon-reload systemctl rest…

速卖通测评攻略:轻松提升店铺曝光度和吸引力

在速卖通平台上,产品排名,店铺曝光的提升无疑是所有卖家追求的目标,因为这直接关联着产品曝光量的增加和潜在销售机会的扩大。然而,提升产品排名并非一蹴而就,它需要一系列的策略和技巧。那么,接下来就让我…

【网络安全】跨站脚本攻击漏洞—HTML前端基础

目录 一、HTML概述 1.1 head部分 1.2 body部分 1.3 HTML特殊符号 二、JavaScript概述 2.1 HTML中JavaScript的存在方式 2.2 DOM操作 2.3 BOM操作 跨站脚本攻击(Cross-site scripting,通常缩写为XSS)是一种常见的网络安全漏洞&#xff…

区块链实验室(36) - 交叉编译Ethereum的客户端全套工具

停滞了一段时间,重新回到区块链实验。前面在“区块链实验室(31) - 交叉编译Ethereum的客户端Geth”中仅编译出客户端工具geth。编译Ethereum全套工具的代码如下。 #!/bin/bash ## abigen CGO_ENABLED0 GOOSlinux GOARCHarm64 /usr/local/go/bin/go build -ldflags …