taki0112 commited on
Commit
82201a6
β€’
1 Parent(s): 95aa48f
Files changed (1) hide show
  1. app.py +9 -6
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
- torch_dtype = torch.float32
21
- else:
22
- torch_dtype = torch.float16
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`.