Closed TamirBaydasov closed 1 month ago
Demo used to check image quality:
import mindspore as ms
import requests
from PIL import Image
from io import BytesIO
from mindone.diffusers import StableDiffusionImg2ImgPipeline
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
"runwayml/stable-diffusion-v1-5",
mindspore_dtype=ms.float32,
use_safetensors=True,
)
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, verify=False)
image = Image.open(BytesIO(response.content)).convert("RGB")
image.thumbnail((768, 768))
ms.set_context(device_target='GPU', mode=0)
image = pipe(
prompt=prompt,
image=image,
num_inference_steps=50,
strength=0.75,
guidance_scale=10.5
)[0][0]
Closed due to merge with https://github.com/mindspore-lab/mindone/pull/474
What does this PR do?
Fixes # (issue)
Adds # (feature)
Before submitting
What's New
. Here are the documentation guidelinesWho can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
@xxx