Instructions to use PrunaAI/p-image-edit-photo-to-anime-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use PrunaAI/p-image-edit-photo-to-anime-lora 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("fill-in-base-model", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("PrunaAI/p-image-edit-photo-to-anime-lora") prompt = "transform into anime" 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
- Local Apps Settings
- Draw Things
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: image-to-image
|
| 3 |
+
tags:
|
| 4 |
+
- image-to-image
|
| 5 |
+
- lora
|
| 6 |
+
- diffusers
|
| 7 |
+
- template:diffusion-lora
|
| 8 |
+
widget:
|
| 9 |
+
- output:
|
| 10 |
+
url: images/example_001.png
|
| 11 |
+
text: transform into anime
|
| 12 |
+
- output:
|
| 13 |
+
url: images/example_002.png
|
| 14 |
+
text: transform into anime
|
| 15 |
+
- output:
|
| 16 |
+
url: images/example_003.png
|
| 17 |
+
text: transform into anime
|
| 18 |
+
- output:
|
| 19 |
+
url: images/example_004.png
|
| 20 |
+
text: transform into anime
|
| 21 |
+
- output:
|
| 22 |
+
url: images/example_005.png
|
| 23 |
+
text: transform into anime
|
| 24 |
+
license: apache-2.0
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# Photo To Anime Lora
|
| 28 |
+
|
| 29 |
+
<Gallery />
|
| 30 |
+
|
| 31 |
+
## Model description
|
| 32 |
+
|
| 33 |
+
This is an image-editing LoRA. Provide an input image and an instruction describing the edit. **Trigger word:** use `transform into anime` in your instructions for best results. The examples below show input → output for different instructions.
|
| 34 |
+
|
| 35 |
+
## Trigger word
|
| 36 |
+
|
| 37 |
+
Include **`transform into anime`** in your edit instruction, for example:
|
| 38 |
+
|
| 39 |
+
```
|
| 40 |
+
transform into anime <your edit instruction here>
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Gallery
|
| 44 |
+
|
| 45 |
+
### Example 1
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
|
| 49 |
+
*Prompt:* transform into anime
|
| 50 |
+
|
| 51 |
+
*Input:* 
|
| 52 |
+
|
| 53 |
+
### Example 2
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
|
| 57 |
+
*Prompt:* transform into anime
|
| 58 |
+
|
| 59 |
+
*Input:* 
|
| 60 |
+
|
| 61 |
+
### Example 3
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
|
| 65 |
+
*Prompt:* transform into anime
|
| 66 |
+
|
| 67 |
+
*Input:* 
|
| 68 |
+
|
| 69 |
+
### Example 4
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
|
| 73 |
+
*Prompt:* transform into anime
|
| 74 |
+
|
| 75 |
+
*Input:* 
|
| 76 |
+
|
| 77 |
+
### Example 5
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
|
| 81 |
+
*Prompt:* transform into anime
|
| 82 |
+
|
| 83 |
+
*Input:* 
|
| 84 |
+
|
| 85 |
+
## LoRA scale
|
| 86 |
+
|
| 87 |
+
The gallery was generated with **`lora_scale=1.0`**. You can tune this when running inference (e.g. lower for a subtler effect, higher for a stronger style).
|
| 88 |
+
|
| 89 |
+
## Use on Replicate
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
import replicate
|
| 93 |
+
|
| 94 |
+
output = replicate.run(
|
| 95 |
+
"prunaai/p-image-edit-lora:17651bd22e8c151cdb13a97b0f8554dce1e7238cd0a18cf90bc237ac5f0bc067",
|
| 96 |
+
input={
|
| 97 |
+
"images": ["https://example.com/input.png"],
|
| 98 |
+
"prompt": "transform into anime your edit instruction",
|
| 99 |
+
"lora_weights": "https://huggingface.co/davidberenstein1957/p-image-edit-photo-to-anime-lora/resolve/main/weights.safetensors",
|
| 100 |
+
"lora_scale": 1.0,
|
| 101 |
+
"hf_api_token": "your-hf-token",
|
| 102 |
+
}
|
| 103 |
+
)
|
| 104 |
+
```
|
| 105 |
+
|