Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ if torch.cuda.is_available():
|
|
| 8 |
PYTORCH_CUDA_ALLOC_CONF={'max_split_size_mb': 6000}
|
| 9 |
torch.cuda.max_memory_allocated(device=device)
|
| 10 |
torch.cuda.empty_cache()
|
| 11 |
-
pipe = DiffusionPipeline.from_pretrained("SG161222/
|
| 12 |
pipe.enable_xformers_memory_efficient_attention()
|
| 13 |
pipe = pipe.to(device)
|
| 14 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
|
@@ -18,7 +18,7 @@ if torch.cuda.is_available():
|
|
| 18 |
refiner.enable_sequential_cpu_offload()
|
| 19 |
refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
| 20 |
else:
|
| 21 |
-
pipe = DiffusionPipeline.from_pretrained("SG161222/
|
| 22 |
pipe = pipe.to(device)
|
| 23 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
| 24 |
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True)
|
|
@@ -42,7 +42,7 @@ gr.Interface(fn=genie, inputs=[gr.Textbox(label='Positive Promt. 77 Token Limit.
|
|
| 42 |
gr.Textbox(label='Embedded Negative Prompt'),
|
| 43 |
gr.Slider(minimum=.7, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %')],
|
| 44 |
outputs='image',
|
| 45 |
-
title=" 📷 Realistic Vision XL
|
| 46 |
description="The model is still in the training phase. This is not the final version and may contain artifacts and perform poorly in some cases. Currently running on <b>CPU</b>",
|
| 47 |
article="Demo prompt template below to get an example of the models results:<br><br><b>Positive prompt:</b> dark shot, photo of cute 24 y.o blonde woman, perfect eyes, skin moles, short hair, looks at viewer, cinematic shot, hard shadows<br><br><b>Negative prompt:</b> (worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth <br><br> Iteration Steps: 15-40, Denoising strength: 0.25-0.5, CFG scale: 7, Seed: 4271781772<br><br> <b>WARNING:</b> Be patient, as generation is Slow.<br>65s/Iteration. Expected Generation Time is 25-50mins an image for 25-50 iterations respectively. This model is capable of producing mild NSFW images"
|
| 48 |
).launch(debug=True, max_threads=80)
|
|
|
|
| 8 |
PYTORCH_CUDA_ALLOC_CONF={'max_split_size_mb': 6000}
|
| 9 |
torch.cuda.max_memory_allocated(device=device)
|
| 10 |
torch.cuda.empty_cache()
|
| 11 |
+
pipe = DiffusionPipeline.from_pretrained("SG161222/RealVisXL_V2.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
| 12 |
pipe.enable_xformers_memory_efficient_attention()
|
| 13 |
pipe = pipe.to(device)
|
| 14 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
|
|
|
| 18 |
refiner.enable_sequential_cpu_offload()
|
| 19 |
refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
| 20 |
else:
|
| 21 |
+
pipe = DiffusionPipeline.from_pretrained("SG161222/RealVisXL_V2.0", use_safetensors=True)
|
| 22 |
pipe = pipe.to(device)
|
| 23 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
| 24 |
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True)
|
|
|
|
| 42 |
gr.Textbox(label='Embedded Negative Prompt'),
|
| 43 |
gr.Slider(minimum=.7, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %')],
|
| 44 |
outputs='image',
|
| 45 |
+
title=" 📷 Realistic Vision XL V2.0 Demo by SG161222 📷",
|
| 46 |
description="The model is still in the training phase. This is not the final version and may contain artifacts and perform poorly in some cases. Currently running on <b>CPU</b>",
|
| 47 |
article="Demo prompt template below to get an example of the models results:<br><br><b>Positive prompt:</b> dark shot, photo of cute 24 y.o blonde woman, perfect eyes, skin moles, short hair, looks at viewer, cinematic shot, hard shadows<br><br><b>Negative prompt:</b> (worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth <br><br> Iteration Steps: 15-40, Denoising strength: 0.25-0.5, CFG scale: 7, Seed: 4271781772<br><br> <b>WARNING:</b> Be patient, as generation is Slow.<br>65s/Iteration. Expected Generation Time is 25-50mins an image for 25-50 iterations respectively. This model is capable of producing mild NSFW images"
|
| 48 |
).launch(debug=True, max_threads=80)
|