Instructions to use peter-sushko/RealEdit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use peter-sushko/RealEdit 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("peter-sushko/RealEdit", 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
|
@@ -38,16 +38,19 @@ pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dt
|
|
| 38 |
pipe.to("cuda")
|
| 39 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 40 |
|
| 41 |
-
|
| 42 |
-
url = "https://raw.githubusercontent.com/timothybrooks/instruct-pix2pix/main/imgs/example.jpg"
|
| 43 |
def download_image(url):
|
| 44 |
image = PIL.Image.open(requests.get(url, stream=True).raw)
|
| 45 |
image = PIL.ImageOps.exif_transpose(image)
|
| 46 |
image = image.convert("RGB")
|
| 47 |
return image
|
| 48 |
-
image = download_image(url)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
prompt = "turn him into cyborg" -->
|
| 51 |
images = pipe(prompt, image=image, num_inference_steps=10, image_guidance_scale=1).images
|
| 52 |
images[0]
|
| 53 |
```
|
|
|
|
| 38 |
pipe.to("cuda")
|
| 39 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 40 |
|
| 41 |
+
# edit this:
|
| 42 |
+
<!-- url = "https://raw.githubusercontent.com/timothybrooks/instruct-pix2pix/main/imgs/example.jpg"
|
| 43 |
def download_image(url):
|
| 44 |
image = PIL.Image.open(requests.get(url, stream=True).raw)
|
| 45 |
image = PIL.ImageOps.exif_transpose(image)
|
| 46 |
image = image.convert("RGB")
|
| 47 |
return image
|
| 48 |
+
#image = download_image(url)
|
| 49 |
+
|
| 50 |
+
#prompt = "turn him into cyborg"
|
| 51 |
+
-->
|
| 52 |
+
|
| 53 |
|
|
|
|
| 54 |
images = pipe(prompt, image=image, num_inference_steps=10, image_guidance_scale=1).images
|
| 55 |
images[0]
|
| 56 |
```
|