---
language:
- en
tags:
- stable-diffusion
- text-to-image
- image-to-image
- photo
pipeline_tag: text-to-image
---
# Leia photo sd
`MykosX/leia-photo-sd` is a Stable Diffusion model that can be used both for:
- text-to-image: generates quite good photo images, may generate bad faces for people far from viewer
- image-to-image: tends to improve the quality of images generated by this model, does a good work on images from other models
## Image show-case
|
(seed=300)** |
(seed=400)** |
(seed=500)** |
|
text-to-image
|
|
|
|
|
image-to-image
|
|
|
|
|
(seed=300)** |
(seed=400)** |
(seed=500)** |
|
text-to-image
|
|
|
|
|
image-to-image
|
|
|
|
| Base image (from another model) |
image-to-image (seed=300)** |
image-to-image (seed=400)** |
image-to-image (seed=500)** |
|
|
|
|
|
|
|
|
| Base image (from another model) |
image-to-image (seed=300)* |
image-to-image (seed=400)* |
image-to-image (seed=500)* |
** using these defaults unless specified:
| Setting |
Default value |
| prompt (landscape) |
landscape image, a boy and girl having fun on the beach |
| prompt (portrait) |
portrait image, a girl in a nice dress posing for a photo |
| negative prompt |
deformed iris, deformed pupils, bad anatomy, cloned face, extra arms, extra legs, missing fingers, too many fingers |
| size (landscape) |
1024 x 768 |
| size (portrait) |
768 x 1024 |
| seed |
300 |
| guidance scale |
12.0 |
| strength |
0.5 |
| inference steps |
30 |
## Diffusers
For more general information on how to run text-to-image models with 🧨 Diffusers, see [the docs](https://huggingface.co/docs/diffusers/using-diffusers/conditional_image_generation).
1. Installation
```
pip install diffusers transformers accelerate
```
2. Running example for text-to-image generation
```py
import torch
from diffusers import AutoPipelineForText2Image
pipe = AutoPipelineForText2Image.from_pretrained('MykosX/leia-photo-sd', torch_dtype=torch.float32)
pipe = pipe.to("cpu")
prompt = "portrait image, a girl in a nice dress posing for a photo"
image = pipe(prompt).images[0]
image.save("./images/text-to-image.png")
```
3. Running example for image-to-image generation
```py
import torch
from diffusers import AutoPipelineForImage2Image
from PIL import Image
pipe = AutoPipelineForImage2Image.from_pretrained('MykosX/leia-photo-sd', torch_dtype=torch.float32)
pipe = pipe.to("cpu")
base_image = Image.open("./images/girl-posing-photo-(original).jpg")
prompt = "portrait image, a girl in a nice dress posing for a photo"
image = pipe(prompt, image=base_image).images[0]
image.save("./images/image-to-image.png")
```
## PS
Play with the model and don't hesitate to show off