首页  >  案例  >  文章
2023-11-23 17:57

AI 文艺复兴丨如何用Stable Diffusion复现经典古诗场景《水调歌头》

一、AI文艺复兴

一)参与活动

现在ai绘画越来越多人玩了 并且通过ai也让更多的人了解不同的艺术创作了

正好知乎科技最近也举办了一场 ai 文艺复兴活动

具体要求可以看活动链接:

看了之后非常感兴趣 于是我便选择了 AI 复现古诗文场景 进行尝试 

使用AI: StableDiffusion

平台:秋葉推荐的云平台-揽睿星舟

二)《水调歌头》古诗场景复现

我选择了苏轼的 《水调歌头》

明月几时有,把酒问青天。不知天上宫阙,今夕是何年。

我欲乘风归去,又恐琼楼玉宇,高处不胜寒。

起舞弄清影,何似在人间。转朱阁,低绮窗,照无眠。

不应有恨,何事长向别时圆? 人有悲欢离合,月有阴晴圆缺, 此事古难全。

但愿人长久,千里共婵娟。

先来看看利用sd 画出的最终效果是如何的吧 (后面会附上提示词和创作过程):

图片

使用StableDiffusion制作,平台:揽睿星舟

图片

使用StableDiffusion制作,平台:揽睿星舟

图片

使用StableDiffusion制作,平台:揽睿星舟

图片

使用StableDiffusion制作,平台:揽睿星舟

二、SD安装与部署

很多人因为设备问题 无法在本地部署 我也是如此 因此我采用的是云部署

使用的平台是揽睿星舟(秋叶大佬也一直在推荐使用)

我使用了已经有几个月了 总结了以下一些优点

1.按小时计费 便宜 不想用的时候关掉就好

2.一键部署,集成了大量插件 开箱即用 主流插件和controlnet都已经安装好了 这对新手很重要

3.平台会不断更新内容 SD版本更新至1.6及支持SDXL 内置模型更新至200余个

4.可以通过网盘上传自己的模型 快速高效

接下来带大家一步步的进行实操和使用:

一) 注册

注册步骤很简单 填好信息就可以了

记得填写邀请码 新用户会有3.8 优惠券使用 免费白嫖使用 可以先体验一下还是不错的

揽睿星舟-一站式AI服务平台和AI应用生态www.lanrui-ai.com/register?invitation_code=1460

图片

二) 使用优惠券

进入用户界面后 点击右上角头像 然后点击充值按钮 选中优惠券就可以进行0元充值啦 3.8到手!

图片

图片

三) 创建空间

进入算力市场 可以选择购买 3090 或者 4090 出图都是很快的

图片

购买后进行镜像选择

镜像选择 sd-webui4.0 latest

数据集选择 sd-base

最后进行创建就好了

图片

四) 启动运行

创建好实例后 启动需要等待一小会

直接选择 进入 jupterlab 或者 vscode 选择一个即可 主要目的就是为了去启动程序

图片

进入jupterlab 后选中terminal

在控制台输入一行命令来启动 如果您没有安装额外的插件,推荐加上--skip-prepare-environment

bash /app/start.sh --skip-prepare-environment

最后出现 ip地址就说明运行起来了

回到控制台 复制调试地址 在浏览器打开即可运行了

能打开网址 说明已经成功了 恭喜你!

接下来就是玩转stable diffusion 了

三 创作过程

一)拆解诗词 利用gpt生成提示词

诗词拆解可以利用chatgpt 进行翻译和拆解 也可以直接把古诗词丢给gpt 直接进行生成

提示词主要包含画面主体、材质、附加细节、图像质量、艺术风格、色彩色调、灯光等部分

这里分享我使用的是sd 生成提示词:

I want you to respond only in language [TARGETLANGUAGE].

[PROMPT]

use this information to learn about Stable diffusion Prompting,and use it to create prompts.

Stable Diffusion is an AI art generation model similar to DALLE-2.

It can be used to create impressive artwork by using positive and negative prompts. Positive prompts describe what should be included in the image.

very important is that the Positive Prompts are usually created in a specific structure:

(Subject),(Action),(Context),(Environment),(Lightning),(Artist),(Style),(Medium),(Type),(Color Sheme),(Computer graphics),(Quality),(etc.)

Subject: Person,animal,landscape

Action: dancing,sitting,surveil

Verb: What the subject is doing,such as standing,sitting,eating,dancing,surveil

Adjectives: Beautiful,realistic,big,colourful

Context: Alien planet's pond,lots of details

Environment/Context: Outdoor,underwater,in the sky,at night

Lighting: Soft,ambient,neon,foggy,Misty

Emotions: Cosy,energetic,romantic,grim,loneliness,fear

Artist: Pablo Picasso,Van Gogh,Da Vinci,Hokusai

Art medium: Oil on canvas,watercolour,sketch,photography

style: Polaroid,long exposure,monochrome,GoPro,fisheye,bokeh,Photo,8k uhd,dslr,soft lighting,high quality,film grain,Fujifilm XT3

Art style: Manga,fantasy,minimalism,abstract,graffiti

Material: Fabric,wood,clay,Realistic,illustration,drawing,digital painting,photoshop,3D

Colour scheme: Pastel,vibrant,dynamic lighting,Green,orange,red

Computer graphics: 3D,octane,cycles

Illustrations: Isometric,pixar,scientific,comic

Quality: High definition,4K,8K,64K

example Prompts:

- overwhelmingly beautiful eagle framed with vector flowers,long shiny wavy flowing hair,polished,ultra detailed vector floral illustration mixed with hyper realism,muted pastel colors,vector floral details in background,muted colors,hyper detailed ultra intricate overwhelming realism in detailed complex scene with magical fantasy atmosphere,no signature,no watermark

- electronik robot and ofice,unreal engine,cozy indoor lighting,artstation,detailed,digital painting,cinematic,character design by mark ryden and pixar and hayao miyazaki,unreal 5.daz,hyperrealistic,octane render

- underwater world,plants,flowers,shells,creatures,high detail,sharp focus,4k

- picture of dimly lit living room,minimalist furniture,vaulted ceiling,huge room,floor to ceiling window with an ocean view,nighttime

- A beautiful painting of water spilling out of a broken pot,earth colored clay pot,vibrant background,by greg rutkowski and thomas kinkade,Trending on artstation,8k,hyperrealistic,extremely detailed

- luxus supercar in drive way of luxus villa in black dark modern house with sunlight black an white modern

- higly detailed,majestic royal tall ship on a calm sea,realistic painting,by Charles Gregory Artstation and Antonio Jacobsen and Edward Moran,(long shot),clear blue sky,intricated details,4k

- smooth meat table,restaurant,paris,elegant,lights

Negative prompt are things you don't want to be included in the generated images,everything in one word divided by only commas not period.

use this Negative Prompts and add some words what you think that match to Prompt: ugly,tiling,poorly drawn hands,poorly drawn feet,poorly drawn face,out of frame,extra limbs,disfigured,deformed,body out of frame,bad anatomy,watermark,signature,cut off,low contrast,underexposed,overexposed,bad art,beginner,amateur,distorted face,blurry,draft,grainy,etc

very important: use an artist matching to the art style,or dont write any artist if it is realistic style or some of that.

I want you to write me one full detailed prompt about the idea written from me,first in (Subject),(Action),(Context),(Environment),(Lightning),(Artist),(Style),(Medium),(Type),(Color Sheme),(Computer graphics),(Quality),(etc.). then in Positive Prompt: write in next line for Positive Prompt,Follow the structure of the example prompts,and Nagative Prompts: write in next line for Negativ Prompts about the idea written from me in words divided by only commas not period. This means a short but full description of the scene,followed by short modifiers divided by only commas not period to alter the mood,style,lighting,artist,etc. write all prompts in english.

生成结果:

最高画质,大师杰作,一个孤独的年轻人坐在月光下,拿着酒瓶,凝视着浩瀚的天空。古老的宫殿和塔楼依稀可见,家家户户的灯火通明。他起身欲骑鸟,衣袖飘舞。月光朦胧,投射出淡淡的影子。他走进一座朱色楼阁,望着窗外,月光映照着他对圆满的追求。具有中国水墨气息的画面,仿倪园、齐白石的风格,淡雅古朴

二)lora 选用

揽睿星舟内置了不少lora 我选择的是具有“小人书”风格的 xrs2.0 还有其他不同国风插画的lora 也可以进行尝试

图片

三)文生图

最后直接采用文生图进行绘制就可以了

附上提示词和参数

正向提示词:((bestquality)),((masterpiece)),(detailed),realistic,A lonely young man sitting under the moonlight, holding a wine bottle, gazing at the vast sky. Ancient palaces and towers faintly visible, lights from common households. He stands up wanting to ride a bird, dancing with his sleeves fluttering. Moonlight is hazy, casting a light shadow. He walks into a vermilion pavilion, gazing out the window, moonlight reflecting his pursuit of fulfillment. An image with Chinese ink wash atmosphere, depicted in the style of Ni Yuan and Qi Baishi, light and simple, delicate and evocative

正向提示词:((bestquality)),((masterpiece)),(detailed),realistic,一个孤独的年轻人坐在月光下,拿着酒瓶,凝视着广阔的天空。古老的宫殿和塔楼隐约可见,普通家庭的灯光。他站起来想骑一只鸟,袖子飘舞着跳舞。月光朦胧,投下淡影。他走进一个朱红色的亭子,凝视着窗外,月光映照着他对成就的追求。一幅具有中国水墨气息的画面,以倪远、齐白石的风格描绘,轻盈朴实,细腻而令人回味无穷

负向提示词: blurry, dark, lacking details, bad anatomy, chopped together, disjointed, low quality, amateur, text, watermark, stains, warped, incomplete, green, ugly

负向提示词: blurry, dark, lacking details, bad anatomy, chopped together, disjointed, low quality, amateur, text, watermark, stains, warped, incomplete, green, ugly

Steps: 30. Sampler: DPM++ 2M Model: sd_xl_base_1.0

步骤:30.采样器:DPM++ 2M 型号:sd_xl_base_1.0

3

相关文章