in

stable diffusion xl base 1.0 ModelScope vs Diffusers

How to generate stable diffusion xl base 1.0 ModelScope vs Diffusers 如何生成稳定的扩散 xl base 1.0 ModelScope 与扩散器

pip install “modelscope[audio,cv,nlp,multi-modal,science]” -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

from modelscope.utils.constant import Tasks from modelscope.pipelines import pipeline import cv2 pipe = pipeline(task=Tasks.text_to_image_synthesis, model=’AI-ModelScope/stable-diffusion-xl-base-1.0′, use_safetensors=True, model_revision=’v1.0.0′) prompt = ‘a dog’ output = pipe({‘text’: prompt}) cv2.imwrite(‘result.png’, output[‘output_imgs’][0])

from diffusers import DiffusionPipeline import torch pipe = DiffusionPipeline.from_pretrained(“stabilityai/stable-diffusion-xl-base-1-0″, torch_dtype=torch.float16, use_safetensors=True, variant=”fp16”) pipe.to(“cuda”) # if using torch < 2.0 # pipe.enable_xformers_memory_efficient_attention() prompt = “An astronaut riding a green horse” images = pipe(prompt=prompt).images[0]

This post was created with our nice and easy submission form. Create your post!

What do you think?

Written by newsaha

Leave a Reply

GIPHY App Key not set. Please check settings

stable diffusion if you ilize stable diffusion, then you can use

stable diffusion error model here anything else I can help you w