Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ import gradio as gr
|
|
33 |
from lxml.html import fromstring
|
34 |
from huggingface_hub import hf_hub_download
|
35 |
from safetensors.torch import load_file, save_file
|
36 |
-
from diffusers import
|
37 |
from PIL import Image, ImageDraw, ImageFont
|
38 |
from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
|
39 |
from refiners.fluxion.utils import manual_seed
|
@@ -445,7 +445,7 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
445 |
# precision data
|
446 |
|
447 |
seq=512
|
448 |
-
image_steps=
|
449 |
img_accu=6.5
|
450 |
|
451 |
# ui data
|
@@ -507,8 +507,8 @@ function custom(){
|
|
507 |
|
508 |
# torch pipes
|
509 |
|
510 |
-
image_pipe =
|
511 |
-
|
512 |
|
513 |
torch.cuda.empty_cache()
|
514 |
|
|
|
33 |
from lxml.html import fromstring
|
34 |
from huggingface_hub import hf_hub_download
|
35 |
from safetensors.torch import load_file, save_file
|
36 |
+
from diffusers import DiffusionPipeline
|
37 |
from PIL import Image, ImageDraw, ImageFont
|
38 |
from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
|
39 |
from refiners.fluxion.utils import manual_seed
|
|
|
445 |
# precision data
|
446 |
|
447 |
seq=512
|
448 |
+
image_steps=50
|
449 |
img_accu=6.5
|
450 |
|
451 |
# ui data
|
|
|
507 |
|
508 |
# torch pipes
|
509 |
|
510 |
+
image_pipe = DiffusionPipeline.from_pretrained("ostris/Flex.1-alpha", torch_dtype=dtype).to(device)
|
511 |
+
image_pipe.enable_model_cpu_offload()
|
512 |
|
513 |
torch.cuda.empty_cache()
|
514 |
|