justinpinkney commited on
Commit
b32b037
1 Parent(s): 0b6171d

add examples

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. app.py +6 -5
  3. examples/matisse.jpg +0 -0
  4. examples/vermeer.jpg +0 -0
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: Stable Diffusion Image Variations
3
- emoji: 🏃
4
  colorFrom: purple
5
  colorTo: purple
6
  sdk: gradio
 
1
  ---
2
  title: Stable Diffusion Image Variations
3
+ emoji: 🖼️
4
  colorFrom: purple
5
  colorTo: purple
6
  sdk: gradio
app.py CHANGED
@@ -54,7 +54,7 @@ Training was done on 4xA6000 GPUs on [Lambda GPU Cloud](https://lambdalabs.com/s
54
  More details on the method and training will come in a future blog post.
55
  """
56
 
57
- device = "cpu"
58
  pipe = StableDiffusionImageEmbedPipeline.from_pretrained(
59
  "lambdalabs/sd-image-variations-diffusers",
60
  revision="273115e88df42350019ef4d628265b8c29ef4af5",
@@ -71,10 +71,10 @@ inputs = [
71
  output = gr.Gallery(label="Generated variations")
72
  output.style(grid=2)
73
 
74
- # examples = [
75
- # ["assets/im-examples/vermeer.jpg", 3, 1, True, 25],
76
- # ["assets/im-examples/matisse.jpg", 3, 1, True, 25],
77
- # ]
78
 
79
  demo = gr.Interface(
80
  fn=main,
@@ -83,5 +83,6 @@ demo = gr.Interface(
83
  article=article,
84
  inputs=inputs,
85
  outputs=output,
 
86
  )
87
  demo.launch()
 
54
  More details on the method and training will come in a future blog post.
55
  """
56
 
57
+ device = "cuda" if torch.cuda.is_available() else "cpu"
58
  pipe = StableDiffusionImageEmbedPipeline.from_pretrained(
59
  "lambdalabs/sd-image-variations-diffusers",
60
  revision="273115e88df42350019ef4d628265b8c29ef4af5",
 
71
  output = gr.Gallery(label="Generated variations")
72
  output.style(grid=2)
73
 
74
+ examples = [
75
+ ["examples/vermeer.jpg", 3, 1, True, 25],
76
+ ["examples/matisse.jpg", 3, 1, True, 25],
77
+ ]
78
 
79
  demo = gr.Interface(
80
  fn=main,
 
83
  article=article,
84
  inputs=inputs,
85
  outputs=output,
86
+ examples=examples,
87
  )
88
  demo.launch()
examples/matisse.jpg ADDED
examples/vermeer.jpg ADDED