Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ class HFEmbedder(nn.Module):
|
|
64 |
|
65 |
device = "cuda"
|
66 |
t5 = HFEmbedder("silveroxides/t5xxl_flan_enc", max_length=512, torch_dtype=torch.bfloat16).to(device)
|
67 |
-
clip = HFEmbedder("
|
68 |
ae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)
|
69 |
# quantize(t5, weights=qfloat8)
|
70 |
# freeze(t5)
|
@@ -660,8 +660,8 @@ def get_lin_function(
|
|
660 |
def get_schedule(
|
661 |
num_steps: int,
|
662 |
image_seq_len: int,
|
663 |
-
base_shift: float = 0.
|
664 |
-
max_shift: float = 1.
|
665 |
shift: bool = True,
|
666 |
) -> list[float]:
|
667 |
# extra step for zero
|
@@ -832,20 +832,20 @@ def create_demo():
|
|
832 |
with gr.Column():
|
833 |
prompt = gr.Textbox(label="Prompt(νκΈ κ°λ₯)", value="A cute and fluffy golden retriever puppy sitting upright, holding a neatly designed white sign with bold, colorful lettering that reads 'Have a Happy Day!' in cheerful fonts. The puppy has expressive, sparkling eyes, a happy smile, and fluffy ears slightly flopped. The background is a vibrant and sunny meadow with soft-focus flowers, glowing sunlight filtering through the trees, and a warm golden glow that enhances the joyful atmosphere. The sign is framed with small decorative flowers, adding a charming and wholesome touch. Ensure the text on the sign is clear and legible.")
|
834 |
|
835 |
-
width = gr.Slider(minimum=128, maximum=
|
836 |
-
height = gr.Slider(minimum=128, maximum=
|
837 |
-
guidance = gr.Slider(minimum=1.0, maximum=
|
838 |
inference_steps = gr.Slider(
|
839 |
label="Inference steps",
|
840 |
minimum=1,
|
841 |
-
maximum=
|
842 |
step=1,
|
843 |
value=30,
|
844 |
)
|
845 |
seed = gr.Number(label="Seed", precision=-1)
|
846 |
do_img2img = gr.Checkbox(label="Image to Image", value=False)
|
847 |
init_image = gr.Image(label="Input Image", visible=False)
|
848 |
-
image2image_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, label="Noising strength", value=0.
|
849 |
resize_img = gr.Checkbox(label="Resize image", value=True, visible=False)
|
850 |
generate_button = gr.Button("Generate")
|
851 |
|
|
|
64 |
|
65 |
device = "cuda"
|
66 |
t5 = HFEmbedder("silveroxides/t5xxl_flan_enc", max_length=512, torch_dtype=torch.bfloat16).to(device)
|
67 |
+
clip = HFEmbedder("silveroxides/clip-vit-large-patch14", max_length=77, torch_dtype=torch.bfloat16).to(device)
|
68 |
ae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)
|
69 |
# quantize(t5, weights=qfloat8)
|
70 |
# freeze(t5)
|
|
|
660 |
def get_schedule(
|
661 |
num_steps: int,
|
662 |
image_seq_len: int,
|
663 |
+
base_shift: float = 0.6,
|
664 |
+
max_shift: float = 1.25,
|
665 |
shift: bool = True,
|
666 |
) -> list[float]:
|
667 |
# extra step for zero
|
|
|
832 |
with gr.Column():
|
833 |
prompt = gr.Textbox(label="Prompt(νκΈ κ°λ₯)", value="A cute and fluffy golden retriever puppy sitting upright, holding a neatly designed white sign with bold, colorful lettering that reads 'Have a Happy Day!' in cheerful fonts. The puppy has expressive, sparkling eyes, a happy smile, and fluffy ears slightly flopped. The background is a vibrant and sunny meadow with soft-focus flowers, glowing sunlight filtering through the trees, and a warm golden glow that enhances the joyful atmosphere. The sign is framed with small decorative flowers, adding a charming and wholesome touch. Ensure the text on the sign is clear and legible.")
|
834 |
|
835 |
+
width = gr.Slider(minimum=128, maximum=3072, step=64, label="Width", value=768)
|
836 |
+
height = gr.Slider(minimum=128, maximum=3072, step=64, label="Height", value=768)
|
837 |
+
guidance = gr.Slider(minimum=1.0, maximum=20.0, step=0.1, label="Guidance", value=3.5)
|
838 |
inference_steps = gr.Slider(
|
839 |
label="Inference steps",
|
840 |
minimum=1,
|
841 |
+
maximum=360,
|
842 |
step=1,
|
843 |
value=30,
|
844 |
)
|
845 |
seed = gr.Number(label="Seed", precision=-1)
|
846 |
do_img2img = gr.Checkbox(label="Image to Image", value=False)
|
847 |
init_image = gr.Image(label="Input Image", visible=False)
|
848 |
+
image2image_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, label="Noising strength", value=0.4, visible=False)
|
849 |
resize_img = gr.Checkbox(label="Resize image", value=True, visible=False)
|
850 |
generate_button = gr.Button("Generate")
|
851 |
|