TotoB12 commited on
Commit
459aaf8
·
verified ·
1 Parent(s): 284fff8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -13,12 +13,7 @@ pipe = SanaSprintPipeline.from_pretrained(
13
  "Efficient-Large-Model/Sana_Sprint_0.6B_1024px_diffusers",
14
  torch_dtype=torch.bfloat16
15
  )
16
- pipe2 = SanaSprintPipeline.from_pretrained(
17
- "Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers",
18
- torch_dtype=torch.bfloat16
19
- )
20
  pipe.to(device)
21
- pipe2.to(device)
22
  MAX_SEED = np.iinfo(np.int32).max
23
  MAX_IMAGE_SIZE = 1024
24
 
@@ -29,7 +24,7 @@ def infer(prompt, model_size, seed=42, randomize_seed=False, width=1024, height=
29
  generator = torch.Generator().manual_seed(seed)
30
 
31
  # Choose the appropriate model based on selected model size
32
- selected_pipe = pipe if model_size == "0.6B" else pipe2
33
 
34
  img = selected_pipe(
35
  prompt=prompt,
@@ -44,8 +39,8 @@ def infer(prompt, model_size, seed=42, randomize_seed=False, width=1024, height=
44
  return img.images[0], seed
45
 
46
  examples = [
47
- ["a tiny astronaut hatching from an egg on the moon", "1.6B"],
48
- ["🐶 Wearing 🕶 flying on the 🌈", "1.6B"],
49
  ["an anime illustration of a wiener schnitzel", "0.6B"],
50
  ["a photorealistic landscape of mountains at sunset", "0.6B"],
51
  ]
@@ -78,8 +73,8 @@ with gr.Blocks(css=css) as demo:
78
 
79
  model_size = gr.Radio(
80
  label="Model Size",
81
- choices=["0.6B", "1.6B"],
82
- value="1.6B",
83
  interactive=True
84
  )
85
 
 
13
  "Efficient-Large-Model/Sana_Sprint_0.6B_1024px_diffusers",
14
  torch_dtype=torch.bfloat16
15
  )
 
 
 
 
16
  pipe.to(device)
 
17
  MAX_SEED = np.iinfo(np.int32).max
18
  MAX_IMAGE_SIZE = 1024
19
 
 
24
  generator = torch.Generator().manual_seed(seed)
25
 
26
  # Choose the appropriate model based on selected model size
27
+ selected_pipe = pipe
28
 
29
  img = selected_pipe(
30
  prompt=prompt,
 
39
  return img.images[0], seed
40
 
41
  examples = [
42
+ ["a tiny astronaut hatching from an egg on the moon", "0.6B"],
43
+ ["🐶 Wearing 🕶 flying on the 🌈", "0.6B"],
44
  ["an anime illustration of a wiener schnitzel", "0.6B"],
45
  ["a photorealistic landscape of mountains at sunset", "0.6B"],
46
  ]
 
73
 
74
  model_size = gr.Radio(
75
  label="Model Size",
76
+ choices=["0.6B"],
77
+ value="0.6B",
78
  interactive=True
79
  )
80