Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -137,9 +137,9 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, up
|
|
137 |
if upscale == "Yes":
|
138 |
torch.cuda.max_memory_allocated(device=device)
|
139 |
torch.cuda.empty_cache()
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
torch.cuda.empty_cache()
|
144 |
image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
145 |
torch.cuda.empty_cache()
|
@@ -157,7 +157,7 @@ gr.Interface(fn=genie, inputs=[gr.Radio(['PhotoReal', 'Anime', 'Disney', 'StoryB
|
|
157 |
gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
|
158 |
gr.Slider(512, 1024, 768, step=128, label='Height'),
|
159 |
gr.Slider(512, 1024, 768, step=128, label='Width'),
|
160 |
-
gr.Slider(1, maximum=
|
161 |
gr.Slider(25, maximum=100, value=50, step=25, label='Number of Iterations'),
|
162 |
gr.Slider(minimum=0, step=1, maximum=9999999999999999, randomize=True, label='Seed: 0 is Random'),
|
163 |
gr.Radio(["Yes", "No"], label='SDXL 1.0 Refiner: Use if the Image has too much Noise', value='No'),
|
|
|
137 |
if upscale == "Yes":
|
138 |
torch.cuda.max_memory_allocated(device=device)
|
139 |
torch.cuda.empty_cache()
|
140 |
+
sdxl = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16") if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0")
|
141 |
+
sdxl.enable_xformers_memory_efficient_attention()
|
142 |
+
sdxl = refiner.to(device)
|
143 |
torch.cuda.empty_cache()
|
144 |
image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
145 |
torch.cuda.empty_cache()
|
|
|
157 |
gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
|
158 |
gr.Slider(512, 1024, 768, step=128, label='Height'),
|
159 |
gr.Slider(512, 1024, 768, step=128, label='Width'),
|
160 |
+
gr.Slider(1, maximum=15, value=5, step=.25, label='Guidance Scale'),
|
161 |
gr.Slider(25, maximum=100, value=50, step=25, label='Number of Iterations'),
|
162 |
gr.Slider(minimum=0, step=1, maximum=9999999999999999, randomize=True, label='Seed: 0 is Random'),
|
163 |
gr.Radio(["Yes", "No"], label='SDXL 1.0 Refiner: Use if the Image has too much Noise', value='No'),
|