zhangyang-0123 commited on
Commit
c4cb9b3
·
1 Parent(s): ef427a4
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -22,12 +22,13 @@ pruned_pipe.unet = torch.load(
22
  )
23
  pruned_pipe = pruned_pipe.to(device)
24
 
 
25
  MAX_SEED = np.iinfo(np.int32).max
26
  MAX_IMAGE_SIZE = 1024
27
 
28
 
29
  @spaces.GPU # [uncomment to use ZeroGPU]
30
- def generate_images(prompt, seed, steps, pipe, pruned_pipe):
31
  # Run the model and return images directly
32
  g_cpu = torch.Generator("cuda").manual_seed(seed)
33
  original_image = pipe(prompt=prompt, generator=g_cpu, num_inference_steps=steps).images[0]
@@ -49,13 +50,11 @@ css = """
49
  }
50
  """
51
  header = """
52
- # 🌱 Text-to-Image Generation with EcoDiff Pruned SD-XL (20% Pruning Ratio)
53
- # Under Construction!!!
54
 
55
  <div style="text-align: center; display: flex; justify-content: left; gap: 5px;">
56
  <a href="https://arxiv.org/abs/2412.02852"><img src="https://img.shields.io/badge/ariXv-Paper-A42C25.svg" alt="arXiv"></a>
57
  <a href="https://huggingface.co/zhangyang-0123/EcoDiffPrunedModels"><img src="https://img.shields.io/badge/🤗-Model-ffbd45.svg" alt="HuggingFace"></a>
58
- <a href="https://github.com/YaNgZhAnG-V5/EcoDiff"><img src="https://img.shields.io/badge/GitHub-Code-blue.svg?logo=github&" alt="GitHub"></a>
59
  </div>
60
  """
61
 
@@ -97,8 +96,6 @@ with gr.Blocks(css=css) as demo:
97
  prompt,
98
  seed,
99
  steps,
100
- pipe,
101
- pipe,
102
  ],
103
  outputs=[original_output, ecodiff_output],
104
  )
 
22
  )
23
  pruned_pipe = pruned_pipe.to(device)
24
 
25
+
26
  MAX_SEED = np.iinfo(np.int32).max
27
  MAX_IMAGE_SIZE = 1024
28
 
29
 
30
  @spaces.GPU # [uncomment to use ZeroGPU]
31
+ def generate_images(prompt, seed, steps):
32
  # Run the model and return images directly
33
  g_cpu = torch.Generator("cuda").manual_seed(seed)
34
  original_image = pipe(prompt=prompt, generator=g_cpu, num_inference_steps=steps).images[0]
 
50
  }
51
  """
52
  header = """
53
+ # 🌱 EcoDiff Pruned SD-XL (20% Pruning Ratio)
 
54
 
55
  <div style="text-align: center; display: flex; justify-content: left; gap: 5px;">
56
  <a href="https://arxiv.org/abs/2412.02852"><img src="https://img.shields.io/badge/ariXv-Paper-A42C25.svg" alt="arXiv"></a>
57
  <a href="https://huggingface.co/zhangyang-0123/EcoDiffPrunedModels"><img src="https://img.shields.io/badge/🤗-Model-ffbd45.svg" alt="HuggingFace"></a>
 
58
  </div>
59
  """
60
 
 
96
  prompt,
97
  seed,
98
  steps,
 
 
99
  ],
100
  outputs=[original_output, ecodiff_output],
101
  )