arthurtmonyman commited on
Commit
d5bb4c0
·
verified ·
1 Parent(s): f66af0a

use Flux2KleinPipeline + unpin transformers + klein-tuned defaults

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,7 +3,7 @@ import random
3
  import gradio as gr
4
  import torch
5
  import spaces
6
- from diffusers import Flux2Pipeline
7
 
8
  BASE = "black-forest-labs/FLUX.2-klein-4B"
9
  LORA = "noema-art/impresstation-klein"
@@ -12,7 +12,7 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
12
  MAX_SEED = 2**31 - 1
13
 
14
  dtype = torch.bfloat16
15
- pipe = Flux2Pipeline.from_pretrained(BASE, torch_dtype=dtype, token=HF_TOKEN)
16
  pipe.load_lora_weights(LORA, adapter_name="impresstation", token=HF_TOKEN)
17
  pipe.to("cuda")
18
 
@@ -57,8 +57,8 @@ with gr.Blocks(css=CSS, title="ImpressStation — PS2-ify your image") as demo:
57
  inp = gr.Image(label="Your image", type="pil", height=360)
58
  extra = gr.Textbox(label="Describe / steer (optional)", placeholder="a determined young woman with red pigtails")
59
  with gr.Accordion("Settings", open=False):
60
- steps = gr.Slider(8, 40, value=25, step=1, label="Steps")
61
- guidance = gr.Slider(1.0, 8.0, value=4.0, step=0.1, label="Guidance")
62
  seed = gr.Slider(0, MAX_SEED, value=42, step=1, label="Seed")
63
  randomize = gr.Checkbox(value=True, label="Randomize seed")
64
  go = gr.Button("PS2-ify →", variant="primary")
 
3
  import gradio as gr
4
  import torch
5
  import spaces
6
+ from diffusers import Flux2KleinPipeline
7
 
8
  BASE = "black-forest-labs/FLUX.2-klein-4B"
9
  LORA = "noema-art/impresstation-klein"
 
12
  MAX_SEED = 2**31 - 1
13
 
14
  dtype = torch.bfloat16
15
+ pipe = Flux2KleinPipeline.from_pretrained(BASE, torch_dtype=dtype, token=HF_TOKEN)
16
  pipe.load_lora_weights(LORA, adapter_name="impresstation", token=HF_TOKEN)
17
  pipe.to("cuda")
18
 
 
57
  inp = gr.Image(label="Your image", type="pil", height=360)
58
  extra = gr.Textbox(label="Describe / steer (optional)", placeholder="a determined young woman with red pigtails")
59
  with gr.Accordion("Settings", open=False):
60
+ steps = gr.Slider(4, 30, value=8, step=1, label="Steps")
61
+ guidance = gr.Slider(1.0, 6.0, value=2.5, step=0.1, label="Guidance")
62
  seed = gr.Slider(0, MAX_SEED, value=42, step=1, label="Seed")
63
  randomize = gr.Checkbox(value=True, label="Randomize seed")
64
  go = gr.Button("PS2-ify →", variant="primary")