multimodalart HF staff commited on
Commit
74f2389
1 Parent(s): 0aa94bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -21,7 +21,7 @@ pipe = FluxPipeline.from_pretrained(base_model,
21
  torch_dtype=torch.bfloat16)
22
 
23
  pipe.transformer.to(memory_format=torch.channels_last)
24
- pipe.transformer = torch.compile(pipe.transformer, mode="max-autotune", fullgraph=True)
25
  # pipe.enable_model_cpu_offload()
26
  clip_slider = CLIPSliderFlux(pipe, device=torch.device("cuda"))
27
 
@@ -50,7 +50,7 @@ def convert_to_centered_scale(num):
50
  end = num // 2
51
  return tuple(range(start, end + 1))
52
 
53
- @spaces.GPU(duration=200)
54
  def generate(prompt,
55
  concept_1,
56
  concept_2,
@@ -159,8 +159,8 @@ with gr.Blocks(css=css) as demo:
159
  with gr.Group():
160
  prompt = gr.Textbox(label="Prompt", info="Describe what to be steered by the directions", placeholder="A dog in the park")
161
  with gr.Row():
162
- concept_1 = gr.Textbox(label="1st direction to steer", placeholder="winter")
163
- concept_2 = gr.Textbox(label="2nd direction to steer", placeholder="summer")
164
  x = gr.Slider(minimum=0, value=1.75, step=0.1, maximum=4.0, label="Strength", info="maximum strength on each direction (unstable beyond 2.5)")
165
  submit = gr.Button("Generate directions")
166
  with gr.Column():
 
21
  torch_dtype=torch.bfloat16)
22
 
23
  pipe.transformer.to(memory_format=torch.channels_last)
24
+ #pipe.transformer = torch.compile(pipe.transformer, mode="max-autotune", fullgraph=True)
25
  # pipe.enable_model_cpu_offload()
26
  clip_slider = CLIPSliderFlux(pipe, device=torch.device("cuda"))
27
 
 
50
  end = num // 2
51
  return tuple(range(start, end + 1))
52
 
53
+ @spaces.GPU(duration=65)
54
  def generate(prompt,
55
  concept_1,
56
  concept_2,
 
159
  with gr.Group():
160
  prompt = gr.Textbox(label="Prompt", info="Describe what to be steered by the directions", placeholder="A dog in the park")
161
  with gr.Row():
162
+ concept_1 = gr.Textbox(label="1st direction to steer", info="Starting state", placeholder="winter")
163
+ concept_2 = gr.Textbox(label="2nd direction to steer", info="Finishing state", placeholder="summer")
164
  x = gr.Slider(minimum=0, value=1.75, step=0.1, maximum=4.0, label="Strength", info="maximum strength on each direction (unstable beyond 2.5)")
165
  submit = gr.Button("Generate directions")
166
  with gr.Column():