![from diffusers import StableDiffusionPipeline
import torch
# 初始化管道(首次运行会自动下载约4GB模型)
model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(
model_id,
torch_dtype=torch.float16
).to("cuda")
# 定义生成参数
prompt = (
"A young fashion-forward woman in a vibrant urban outfit, dynamic pose with flowing hair, "
"city street background, neon lights, cinematic lighting, ultra-detailed, 8k resolution, "
"fashion photography, trending on Instagram, style of Annie Leibovitz"
)
image = pipe(prompt).images[0]
image.save("fashion_girl.jpg")](https://preview.qiantucdn.com/58pic/VE/ZS/18/dykhjYDhJpE7fRSaRZvRRWbDH1zjNVqEKt_PIC2018.png!w1024_new_small_ai_2)

从扩散器导入Stable扩散管道 进口火炬 # 初始化管道(首次运行会自动下载约4GB模型) 型号_id =“runwayml/稳定扩散-v1-5” pipe = StableDiffersionPipeline.from_pretrained( 型号_id, torch_dype =torch.float16 ),to(“cuda”) # 定义生成参数 提示=( “一位年轻的时尚前卫女性,穿着充满活力的都市服装,动感的姿势,飘逸的头发,” “城市街道背景,霓虹灯,电影灯光,超详细,8 k分辨率,” “时尚摄影,Instagram上的流行趋势,安妮·莱博维茨的风格” ) Image =管道(提示).images[0] image.save(“fashion_girl.jpg”)
描述你想生成的图片信息,如:画面里有什么风格/元素/色彩
Shift+回车 = 换行
AI可能会犯错误或不完全遵循,请谨慎使用。
同款 0
评论 0