Shuang59 commited on
Commit
ff2dfb3
β€’
1 Parent(s): 30d41e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -306,33 +306,33 @@ def compose(prompt, version, guidance_scale, steps):
306
  model_up.to(device)
307
  return compose_language_descriptions(prompt, guidance_scale, steps)
308
  elif version == 'Stable_Diffusion_1v_4':
 
309
  model.to(cpu)
310
  model_up.to(cpu)
311
- clevr_model.to(cpu)
312
  pipe.to(device)
313
  return stable_diffusion_compose(prompt, guidance_scale, steps)
314
  else:
 
315
  model.to(cpu)
316
  model_up.to(cpu)
317
- pipe.to(cpu)
318
  clevr_model.to(device)
319
  return compose_clevr_objects(prompt, guidance_scale, steps)
320
 
321
 
322
  examples_1 = 'a camel | a forest'
323
- examples_2 = 'A cloudy blue sky | A mountain in the horizon | Cherry Blossoms in front of the mountain'
324
  examples_3 = '0.1, 0.5 | 0.3, 0.5 | 0.5, 0.5 | 0.7, 0.5 | 0.9, 0.5'
325
- examples_4 = 'a river leading into a mountain | red trees on the side'
326
- examples_5 = 'a white church on a hill | birds flying around the church'
327
- examples_6 = 'a boat in a desert | a pink sky'
328
- examples_7 = 'mountains in the background | a blue sky | cows on a pasture'
329
  examples = [
330
- [examples_7, 'Stable_Diffusion_1v_4', 30, 50],
331
- [examples_4, 'Stable_Diffusion_1v_4', 30, 50],
332
- [examples_5, 'Stable_Diffusion_1v_4', 30, 50],
333
- [examples_6, 'Stable_Diffusion_1v_4', 30, 50],
334
- [examples_1, 'GLIDE', 30, 100],
335
- [examples_2, 'GLIDE', 30, 100],
336
  [examples_3, 'CLEVR Objects', 10, 100]
337
  ]
338
 
 
306
  model_up.to(device)
307
  return compose_language_descriptions(prompt, guidance_scale, steps)
308
  elif version == 'Stable_Diffusion_1v_4':
309
+ clevr_model.to(cpu)
310
  model.to(cpu)
311
  model_up.to(cpu)
 
312
  pipe.to(device)
313
  return stable_diffusion_compose(prompt, guidance_scale, steps)
314
  else:
315
+ pipe.to(cpu)
316
  model.to(cpu)
317
  model_up.to(cpu)
 
318
  clevr_model.to(device)
319
  return compose_clevr_objects(prompt, guidance_scale, steps)
320
 
321
 
322
  examples_1 = 'a camel | a forest'
323
+ examples_2 = 'A blue sky | A mountain in the horizon | Cherry Blossoms in front of the mountain'
324
  examples_3 = '0.1, 0.5 | 0.3, 0.5 | 0.5, 0.5 | 0.7, 0.5 | 0.9, 0.5'
325
+ examples_4 = 'red trees | a blue house'
326
+ examples_5 = 'a white church | lightning in the background'
327
+ examples_6 = 'a camel | arctic'
328
+ examples_7 = 'A lake | A mountain | Cherry Blossoms next to the lake'
329
  examples = [
330
+ [examples_7, 'Stable_Diffusion_1v_4', 15, 50],
331
+ [examples_5, 'Stable_Diffusion_1v_4', 15, 50],
332
+ [examples_4, 'Stable_Diffusion_1v_4', 20, 50],
333
+ [examples_6, 'Stable_Diffusion_1v_4', 15, 50],
334
+ [examples_1, 'GLIDE', 15, 100],
335
+ [examples_2, 'GLIDE', 15, 100],
336
  [examples_3, 'CLEVR Objects', 10, 100]
337
  ]
338