Generative AI

“Kitty surrounded by flowers on white background …”
from diffusers import StableDiffusionInpaintPipeline
from PIL import Image
import torch
pipe = StableDiffusionInpaintPipeline.from_pretrained(
        "runwayml/stable-diffusion-inpainting",
        variant="fp16", 
        torch_dtype=torch.float32,
        )
prompt = "cute little kitty with beautiful minimalist flowers, lots of white background"
input_image = Image.open("white.jpg")
mask_image = Image.open("white.jpg")
image = pipe(prompt=prompt, image=input_image, mask_image=mask_image).images[0]
image.save("/Users/mb12aeh/Downloads/more_cats_please.png")

This is code taken from https://www.opensourceforu.com/, you can ask chatgpt to generate similar code. It’s a starter look at generating pictures from text.