File size: 3,748 Bytes
2e4dfd6 df84d52 2e4dfd6 cdb1194 b961e62 cdb1194 b961e62 cdb1194 b961e62 4e705cf 645fa4e 4e705cf 7d04860 645fa4e 05b3486 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
---
tags:
- text-to-image
- lora
- diffusers
- template:diffusion-lora
widget:
- output:
url: images/Screenshot from 2025-12-04 09-36-18.png
text: platypus
base_model: stable-diffusion-v1-5/stable-diffusion-v1-5
instance_prompt: platypus
license: mit
language:
- en
pipeline_tag: text-to-image
library_name: diffusers
---
# LoRA_platypus
<Gallery />
## Trigger words
You should use `platypus` to trigger the image generation.
## Download model
[Download](/Mohan-diffuser/lora_platypus_sd_15/tree/main) them in the Files & versions tab.
```python
import torch
from diffusers import DiffusionPipeline,DDIMScheduler
import matplotlib.pyplot as plt
# switch to "mps" for apple devices
pipeline = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda")
pipeline.load_lora_weights("Mohan-diffuser/lora_platypus_sd_15")
pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config)
prompt = "platypus"
image = pipeline(prompt).images[0]
```
## Varying The LoRA Scale
```python
gen_images=[]
lora_scales = [0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4]
for lora_scale in lora_scales:
gen_image = pipeline(
prompt="platypus",
guidance_scale=7.5,
num_inference_steps=25,
height=512,
width=512,
cross_attention_kwargs={"scale": lora_scale},
generator=torch.manual_seed(0)
).images[0]
gen_images.append(gen_image)
fig,axes = plt.subplots(1,8,figsize=(20,10))
for i,ax in enumerate(axes):
ax.imshow(gen_images[i])
ax.set_title(f"lora_scale: {lora_scales[i]}")
ax.axis('off')
plt.show()
```
## Effect of different prompts
```python
platypus_prompts = [
"A cyberpunk platypus",
"A steampunk platypus with brass gears and mechanical limbs, intricate Victorian-style machinery, warm tones, highly detailed illustration",
"A platypus swimming in a serene river, soft watercolor painting, pastel colors, gentle brush strokes, dreamy atmosphere",
"Cute cartoon platypus, big expressive eyes, playful pose, bright cheerful colors, whimsical style, 2D animation style",
"A fantasy platypus wearing mystical armor, magical glowing runes on its body, standing on a cliff, dramatic lighting, epic fantasy illustration",
"A cybernetic platypus, robotic enhancements, glowing circuits, sci-fi aesthetic, sleek metallic textures, high detail, digital art",
"A platypus in the wild, painted in classical oil painting style, rich textures, dramatic lighting, realistic yet painterly, Baroque-inspired composition",
"A pop art platypus, vibrant contrasting colors, bold outlines, comic-style halftone patterns, playful modern art",
"A platypus rendered in retro pixel art, 16-bit video game style, colorful small-scale grid, cute and nostalgic",
"A surreal platypus floating in a dreamlike landscape, abstract shapes, vibrant colors, imaginative surrealism, Salvador Dali inspired"
]
gen_images=[]
for prompt in platypus_prompts:
gen_image = pipeline(
prompt=prompt,
guidance_scale=7.5,
num_inference_steps=25,
height=512,
width=512,
cross_attention_kwargs={"scale": 0.9},
generator=torch.manual_seed(42)
).images[0]
gen_images.append(gen_image)
fig,axes = plt.subplots(1,10,figsize=(20,10))
for i,ax in enumerate(axes):
ax.imshow(gen_images[i])
ax.axis('off')
plt.show()
```
### Result
 |