Skip to content

Instantly share code, notes, and snippets.

@AlexeyLugovoy
Last active June 10, 2024 19:53
Show Gist options
  • Save AlexeyLugovoy/aa900bd03761e76f2a53ef2991547e25 to your computer and use it in GitHub Desktop.
Save AlexeyLugovoy/aa900bd03761e76f2a53ef2991547e25 to your computer and use it in GitHub Desktop.
from diffusers import AutoPipelineForImage2Image
pipe = AutoPipelineForImage2Image.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True,
cache_dir=CACHE_DIR
).to(DEVICE)
prompt = "New modern style of livingroom, warm color palette, detailed, 8k"
img_gen = pipe(prompt, image=img_pil, strength=0.7, num_inference_steps=100)
img_gen.images[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment