Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,12 +40,11 @@ def infer(
|
|
| 40 |
|
| 41 |
if model == "Ramzes":
|
| 42 |
pipe = StableDiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch_dtype)
|
| 43 |
-
pipe.unet = PeftModel.from_pretrained(
|
| 44 |
-
pipe.text_encoder = PeftModel.from_pretrained(
|
| 45 |
-
pipe = pipe.to(device)
|
| 46 |
else:
|
| 47 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch_dtype)
|
| 48 |
-
|
| 49 |
|
| 50 |
image = pipe(
|
| 51 |
prompt=prompt,
|
|
@@ -96,7 +95,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 96 |
with gr.Accordion("Advanced Settings", open=True):
|
| 97 |
negative_prompt = gr.Text(
|
| 98 |
label="Negative prompt",
|
| 99 |
-
value="dog, cat",
|
| 100 |
max_lines=1,
|
| 101 |
placeholder="Enter a negative prompt",
|
| 102 |
visible=True,
|
|
|
|
| 40 |
|
| 41 |
if model == "Ramzes":
|
| 42 |
pipe = StableDiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch_dtype)
|
| 43 |
+
pipe.unet = PeftModel.from_pretrained(pipe.unet, "Bordoglor/Ramzes_adapter_sd_v1.5/unet")
|
| 44 |
+
pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, "Bordoglor/Ramzes_adapter_sd_v1.5/text_encoder")
|
|
|
|
| 45 |
else:
|
| 46 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch_dtype)
|
| 47 |
+
pipe = pipe.to(device)
|
| 48 |
|
| 49 |
image = pipe(
|
| 50 |
prompt=prompt,
|
|
|
|
| 95 |
with gr.Accordion("Advanced Settings", open=True):
|
| 96 |
negative_prompt = gr.Text(
|
| 97 |
label="Negative prompt",
|
|
|
|
| 98 |
max_lines=1,
|
| 99 |
placeholder="Enter a negative prompt",
|
| 100 |
visible=True,
|