idlebg commited on
Commit
168a0cf
β€’
1 Parent(s): 5984aab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -81,10 +81,10 @@ def save_image_to_hf_space(image_np, image_name):
81
 
82
 
83
 
84
- def genie(prompt, negative_prompt, prompt_2, negative_prompt_2, scale, guidance_scale, height, width, aesthetic_score, negative_aesthetic_score, steps, seed):
85
  torch.cuda.empty_cache()
86
  generator = torch.Generator(device=device).manual_seed(seed)
87
- int_images = pipe1(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images
88
  torch.cuda.empty_cache()
89
  refined_images = pipe2(prompt=prompt, prompt_2=prompt_2, image=int_images, guidance_scale=guidance_scale, aesthetic_score=aesthetic_score, negative_aesthetic_score=negative_aesthetic_score).images
90
  int_image_np = np.array(int_images[0])
@@ -125,6 +125,7 @@ article = f"""
125
  <a href="https://github.com/1e-2" target="_new" rel="ugc"><img src="https://img.shields.io/badge/GitHub-1e--2-green"></a>
126
  <a href="https://www.facebook.com/FFusionAI/" target="_new" rel="ugc"><img src="https://img.shields.io/badge/Facebook-FFusionAI-blue"></a>
127
  <a href="https://civitai.com/models/82039/ffusion-ai-sd-21" target="_new" rel="ugc"><img src="https://img.shields.io/badge/Civitai-FFusionAI-blue"></a>
 
128
  </div>
129
  <a href="mailto:[email protected]"><img src="https://img.shields.io/badge/Email-di%40ffusion.ai-blue?style=for-the-badge&logo=gmail"></a>
130
  </div>
@@ -139,8 +140,6 @@ gr.Interface(fn=genie, inputs=[
139
  gr.Textbox(label='❌ Negative Prompt for Text Encoder 2', placeholder='Negative guidance for text_encoder_2 (Optional)', lines=1),
140
  gr.Slider(3, 25, 10, label='🌊 DiFFusion Scale: Influence of Main Features'),
141
  gr.Slider(1, 10, 5, label='🧭 Guidance Scale: Intensity of Guidance'),
142
- #gr.Slider(640, 1024, 1024, step=128, label='πŸ“ Height'),
143
- #gr.Slider(640, 1280, 1024, step=128, label='πŸ“ Width'),
144
  gr.Slider(1, 10, 6, label='🎨 Aesthetic Score: Preference for Visual Appeal'),
145
  gr.Slider(1, 10, 2.5, label='🚫 Negative Aesthetic Score: Avoidance of Unwanted Aesthetics'),
146
  gr.Slider(10, maximum=80, value=50, step=1, label='πŸ’Ž Number of Diffusion Steps'),
 
81
 
82
 
83
 
84
+ def genie(prompt, negative_prompt, prompt_2, negative_prompt_2, scale, guidance_scale, aesthetic_score, negative_aesthetic_score, steps, seed):
85
  torch.cuda.empty_cache()
86
  generator = torch.Generator(device=device).manual_seed(seed)
87
+ int_images = pipe1(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, num_inference_steps=steps, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images
88
  torch.cuda.empty_cache()
89
  refined_images = pipe2(prompt=prompt, prompt_2=prompt_2, image=int_images, guidance_scale=guidance_scale, aesthetic_score=aesthetic_score, negative_aesthetic_score=negative_aesthetic_score).images
90
  int_image_np = np.array(int_images[0])
 
125
  <a href="https://github.com/1e-2" target="_new" rel="ugc"><img src="https://img.shields.io/badge/GitHub-1e--2-green"></a>
126
  <a href="https://www.facebook.com/FFusionAI/" target="_new" rel="ugc"><img src="https://img.shields.io/badge/Facebook-FFusionAI-blue"></a>
127
  <a href="https://civitai.com/models/82039/ffusion-ai-sd-21" target="_new" rel="ugc"><img src="https://img.shields.io/badge/Civitai-FFusionAI-blue"></a>
128
+ [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/raw/main/duplicate-this-space-lg.svg)](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)
129
  </div>
130
  <a href="mailto:[email protected]"><img src="https://img.shields.io/badge/Email-di%40ffusion.ai-blue?style=for-the-badge&logo=gmail"></a>
131
  </div>
 
140
  gr.Textbox(label='❌ Negative Prompt for Text Encoder 2', placeholder='Negative guidance for text_encoder_2 (Optional)', lines=1),
141
  gr.Slider(3, 25, 10, label='🌊 DiFFusion Scale: Influence of Main Features'),
142
  gr.Slider(1, 10, 5, label='🧭 Guidance Scale: Intensity of Guidance'),
 
 
143
  gr.Slider(1, 10, 6, label='🎨 Aesthetic Score: Preference for Visual Appeal'),
144
  gr.Slider(1, 10, 2.5, label='🚫 Negative Aesthetic Score: Avoidance of Unwanted Aesthetics'),
145
  gr.Slider(10, maximum=80, value=50, step=1, label='πŸ’Ž Number of Diffusion Steps'),