Downloads · 30 days
11
6% of all-time downloads
Vimax97/sd-2-inpainting_background_lora_v1
sd-2-inpainting_background_lora_v1 is a text-to-image model from Vimax97. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as creativeml-openrail-m.
- Model usage: LoRA model for stable-inpainting-2 model to generate various background types: abstract, cartoon, forest - This is not a dreambooth finetuning process, LoRA finetuning on UNet component - Random mask we…
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
171
Public
Repo size
9.1 GB
Likes
0
Public
Click a slice to open those files.
.safetensors8.8 GB · 95%
From the Hugging Face model README
from diffusers import DiffusionPipeline
import torch
from safetensors.torch import load_file
# Load the pre-trained model
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-inpainting", torch_dtype=torch.float16)
pipe = pipe.to("cuda") # Move the model to GPU for faster processing
lora_model_path = "pytorch_lora_weights.safetensors"
# Load and apply LoRA weights
state_dict = load_file(lora_model_path)
pipe.unet.load_attn_procs(state_dict)
prompt = "A farm in the background with flowers, warm lighting, and a cozy, scholarly atmosphere."
negative_prompt = "deformed, ugly, disfigured"
# Generate a new image
generator = torch.Generator(device='cuda:0').manual_seed(123456)
image = pipe(prompt=prompt, image=init_image, mask_image=mask_image, generator=generator, guidance_scale=5, strength=1).images[0]
Generated prompt: a dark jungle, gloomy sky
Generated prompt: Create a cozy living room setting with warm lighting and soft furnishings, placing the pet bed near a fireplace for comfort. Use neutral or warm colours such as beige or light brown for the background to complement the bed's colour and material
Generated prompt: Create a calming living space with a natural color palette and soft lighting, evoking tranquility and comfort. Subtle, diffused light and earthy tones blend seamlessly, forging a cozy atmosphere.