Update app.py
Browse files
app.py
CHANGED
@@ -149,24 +149,3 @@ instance_prompt: {trained_words[0] if trained_words else ''}
|
|
149 |
---
|
150 |
"""
|
151 |
|
152 |
-
# This f-string is now correctly formatted and closed
|
153 |
-
diffusers_md = f"""
|
154 |
-
## {name}
|
155 |
-
|
156 |
-
This is a LoRA model of **{name}**, trained on the base model **{hf_base_model}**.
|
157 |
-
|
158 |
-
### Usage
|
159 |
-
|
160 |
-
To use this model, you'll need the `diffusers` library.
|
161 |
-
|
162 |
-
```python
|
163 |
-
from diffusers import AutoPipelineForText2Image
|
164 |
-
import torch
|
165 |
-
|
166 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
167 |
-
pipe = AutoPipelineForText2Image.from_pretrained("{hf_base_model}").to(device)
|
168 |
-
pipe.load_lora_weights("{repo_name}", weight_name="{weight_filename or 'your_lora.safetensors'}")
|
169 |
-
|
170 |
-
prompt = "{trained_words[0] if trained_words else 'A sample prompt'}"
|
171 |
-
image = pipe(prompt).images[0]
|
172 |
-
image.save("output.png")
|
|
|
149 |
---
|
150 |
"""
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|