Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is wrong with inpaint background? #95

Open
crapthings opened this issue Oct 23, 2023 · 1 comment
Open

what is wrong with inpaint background? #95

crapthings opened this issue Oct 23, 2023 · 1 comment

Comments

@crapthings
Copy link

a
amsk
mask123
download (7)

import torch
import numpy as np
from PIL import Image, ImageOps
from diffusers import AutoPipelineForInpainting
import rembg

modelName = 'kandinsky-community/kandinsky-2-2-decoder-inpaint'

pipe = AutoPipelineForInpainting.from_pretrained(modelName, torch_dtype = torch.float16).to('cuda')
# pipe.enable_model_cpu_offload()


prompt = 'young lady, in front of garden, beautiful, 4k'

image = Image.open('./a.jpg')
mask = Image.open('./mask123.png').convert('RGB')
# mask = ImageOps.invert(mask)
# mask = mask.convert('L')
# mask = np.array(mask)

image = pipe(
    image = image,
    mask_image = mask,
    prompt = prompt,
    width = image.width,
    height = image.height,
    num_inference_steps = 50,
    # prior_steps = 10,
).images[0]

display(image)
@yukselyusuf
Copy link

You can try changing the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants