Image-to-Image
Diffusers
Safetensors
StableDiffusionXLInpaintPipeline
stable-diffusion-xl
inpainting
background-editing
Instructions to use esalahterus/refo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use esalahterus/refo with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("esalahterus/refo", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -39,6 +39,7 @@ result = pipe(
|
|
| 39 |
mask_image=mask_image, # white = background area to edit, black = subject to preserve
|
| 40 |
num_inference_steps=30,
|
| 41 |
guidance_scale=7.5,
|
|
|
|
| 42 |
).images[0]
|
| 43 |
```
|
| 44 |
|
|
|
|
| 39 |
mask_image=mask_image, # white = background area to edit, black = subject to preserve
|
| 40 |
num_inference_steps=30,
|
| 41 |
guidance_scale=7.5,
|
| 42 |
+
strength=1.0, # important: use exactly 1.0 — values like 0.99 only blend lightly instead of fully regenerating the masked area
|
| 43 |
).images[0]
|
| 44 |
```
|
| 45 |
|