当前位置: 首页 > news >正文

免费素材网站可商用兰州又要封城了

免费素材网站可商用,兰州又要封城了,宁波互联网企业,鹤庆县公路建设网站推荐:write_own_pipeline.ipynb - Colab (google.com) 为您的任务选择一个 AutoPipeline 首先选择一个检查点。例如,如果您对使用 runwayml/stable-diffusion-v1-5 检查点的文本到图像感兴趣,请使用 AutoPipelineForText2Image: f…

推荐:write_own_pipeline.ipynb - Colab (google.com)

为您的任务选择一个 AutoPipeline

首先选择一个检查点。例如,如果您对使用 runwayml/stable-diffusion-v1-5 检查点的文本到图像感兴趣,请使用 AutoPipelineForText2Image:

from diffusers import AutoPipelineForText2Image
import torchpipeline = AutoPipelineForText2Image.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, use_safetensors=True
).to("cuda")
prompt = "peasant and dragon combat, wood cutting style, viking era, bevel with rune"image = pipeline(prompt, num_inference_steps=25).images[0]
image

在引擎盖下,AutoPipelineForText2Image:

  1. 自动检测 model_index.json 文件中的类"stable-diffusion"
  2. 根据类名加载对应的文本到图像的 StableDiffusionPipeline"stable-diffusion"

同样,对于图像到图像,AutoPipelineForImage2Image 会从文件中检测检查点,并将在后台加载相应的 StableDiffusionImg2ImgPipeline。还可以传递特定于管道类的任何其他参数,例如 ,它确定添加到输入图像的噪声或变化量:"stable-diffusion"model_index.jsonstrength

from diffusers import AutoPipelineForImage2Image
import torch
import requests
from PIL import Image
from io import BytesIOpipeline = AutoPipelineForImage2Image.from_pretrained("runwayml/stable-diffusion-v1-5",torch_dtype=torch.float16,use_safetensors=True,
).to("cuda")
prompt = "a portrait of a dog wearing a pearl earring"url = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/1665_Girl_with_a_Pearl_Earring.jpg/800px-1665_Girl_with_a_Pearl_Earring.jpg"response = requests.get(url)
image = Image.open(BytesIO(response.content)).convert("RGB")
image.thumbnail((768, 768))image = pipeline(prompt, image, num_inference_steps=200, strength=0.75, guidance_scale=10.5).images[0]
image

原图:

生图:

如果要进行修复,则 AutoPipelineForInpainting 会以相同的方式加载基础 StableDiffusionInpaintPipeline 类:

from diffusers import AutoPipelineForInpainting
from diffusers.utils import load_image
import torchpipeline = AutoPipelineForInpainting.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True
).to("cuda")img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"init_image = load_image(img_url).convert("RGB")
mask_image = load_image(mask_url).convert("RGB")prompt = "A majestic tiger sitting on a bench"
image = pipeline(prompt, image=init_image, mask_image=mask_image, num_inference_steps=50, strength=0.80).images[0]
image

原图:

原掩码图:

生成图像:

好像,,震惊

http://www.yayakq.cn/news/602196/

相关文章:

  • 电子商务网站权限管理问题wordpress侧边栏登录注册
  • 网站模板免费下载php好用的免费crm
  • 上传网站标志网站速度慢如何做优化
  • 制作婚纱摄影网站管理图网站建设比较合理的流程是
  • 怎么做类似知乎的网站wordpress两个头部
  • 二级学院网站建设方案网络营销和市场营销的区别
  • 常州网站建设平台wordpress文章副标题
  • 网站建设文献文档镇江高端网站建设工作室
  • 找兼职工作在家做正规网站在东莞找工作上哪个网站
  • 17网站一起做网店优势与劣势晋江wap站是什么意思
  • 做视频网站版权怎么解决土木英才网招聘信息
  • 美橙互联 送网站上海地区网站开发公司
  • 网站域名与网站首页网址网站开发仿站
  • wordpress 插件官网seo友情链接是什么
  • 腾讯云如何建设网站首页网站集群系统 如何做域名解析
  • 墨客网站建设xcyxqc深圳建站服务公司
  • 做网站能挣钱吗网站建设h5
  • 如何做转发文章赚钱的网站长沙旅游网站建设
  • 网站建设意义和作用wordpress编辑器自动标签
  • vs做网站怎么调试网页的后缀名有那些
  • 切图做网站过时了吗湖南建设人力资源官方网站
  • 创建一个网站的条件有哪些财务记账网站建设需要摊销吗
  • 企业网站优化关键词零基础怎么建设网站
  • 做导航网站怎么盈利简单网页设计模板源代码
  • 合肥做网站怎么样做图书网站赚钱么
  • 承德工程建设信息网站网站建设包括哪些方面?
  • 一般的网站都是用什么系统做的自己做的网站怎么上线
  • 南宁企业建站模板东营网站seo服务
  • 做网站需要哪些程序员免费的网站空间
  • 睢宁县凌城做网站的wordpress运行加速