Spaces:
Runtime error
Runtime error
fix
Browse files
app.py
CHANGED
|
@@ -15,12 +15,14 @@ from transformers import Blip2Processor, Blip2ForConditionalGeneration
|
|
| 15 |
from diffusers import DDIMScheduler
|
| 16 |
import spaces
|
| 17 |
|
| 18 |
-
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 19 |
-
if device == 'cpu':
|
| 20 |
-
|
| 21 |
-
else:
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
def memory_efficient(model):
|
| 25 |
try:
|
| 26 |
model.to(device)
|
|
@@ -381,6 +383,7 @@ description_md = """
|
|
| 381 |
### We introduce `Visual Style Prompting`, which reflects the style of a reference image to the images generated by a pretrained text-to-image diffusion model without finetuning or optimization (e.g., Figure N).
|
| 382 |
### π [[Paper](https://arxiv.org/abs/2402.12974)] | β¨ [[Project page](https://curryjung.github.io/VisualStylePrompt)] | β¨ [[Code](https://github.com/naver-ai/Visual-Style-Prompting)]
|
| 383 |
---
|
|
|
|
| 384 |
### π₯ To try out our vanilla demo,
|
| 385 |
1. Choose a `style reference` from the collection of images below.
|
| 386 |
2. Enter the `text prompt`.
|
|
|
|
| 15 |
from diffusers import DDIMScheduler
|
| 16 |
import spaces
|
| 17 |
|
| 18 |
+
# device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 19 |
+
# if device == 'cpu':
|
| 20 |
+
# torch_dtype = torch.float32
|
| 21 |
+
# else:
|
| 22 |
+
# torch_dtype = torch.float16
|
| 23 |
+
|
| 24 |
+
device = 'cuda'
|
| 25 |
+
torch_dtype = torch.float16
|
| 26 |
def memory_efficient(model):
|
| 27 |
try:
|
| 28 |
model.to(device)
|
|
|
|
| 383 |
### We introduce `Visual Style Prompting`, which reflects the style of a reference image to the images generated by a pretrained text-to-image diffusion model without finetuning or optimization (e.g., Figure N).
|
| 384 |
### π [[Paper](https://arxiv.org/abs/2402.12974)] | β¨ [[Project page](https://curryjung.github.io/VisualStylePrompt)] | β¨ [[Code](https://github.com/naver-ai/Visual-Style-Prompting)]
|
| 385 |
---
|
| 386 |
+
### π To better reflect the style of a user's image, the higher the resolution, the better.
|
| 387 |
### π₯ To try out our vanilla demo,
|
| 388 |
1. Choose a `style reference` from the collection of images below.
|
| 389 |
2. Enter the `text prompt`.
|