Update app.py
Browse files
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,
|
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,
|
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:di@ffusion.ai"><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:di@ffusion.ai"><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'),
|