RohitGandikota commited on
Commit
b4c8ed9
·
verified ·
1 Parent(s): 9491756

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -63,6 +63,7 @@ pipe = DiffusionPipeline.from_pretrained(model_repo_id, unet=unet, torch_dtype=t
63
  pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
64
  pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesdxl", torch_dtype=torch_dtype).to(device)
65
 
 
66
  unet = pipe.unet
67
 
68
  ## Change these parameters based on how you trained your sliderspace sliders
@@ -92,7 +93,7 @@ base_model_id = "black-forest-labs/FLUX.1-schnell"
92
  max_sequence_length = 256
93
  flux_pipe = FluxPipeline.from_pretrained(base_model_id, torch_dtype=torch_dtype)
94
  flux_pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch_dtype)
95
- flux_pipe = flux_pipe.to(device)
96
  # pipe.enable_sequential_cpu_offload()
97
  transformer = flux_pipe.transformer
98
 
@@ -239,6 +240,15 @@ with gr.Blocks(css=css) as demo:
239
  💻 [GitHub Code](https://github.com/rohitgandikota/sliderspace)
240
  """)
241
 
 
 
 
 
 
 
 
 
 
242
  with gr.Row():
243
  prompt = gr.Text(
244
  label="Prompt",
@@ -260,7 +270,7 @@ with gr.Blocks(css=css) as demo:
260
  with gr.Row():
261
  slider_space = gr.Dropdown(
262
  choices=SDXL_CONCEPTS,
263
- label="SliderSpace Concept",
264
  value=SDXL_CONCEPTS[0]
265
  )
266
  discovered_directions = gr.Dropdown(
 
63
  pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
64
  pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesdxl", torch_dtype=torch_dtype).to(device)
65
 
66
+ pipe = pipe.to(torch_dtype)
67
  unet = pipe.unet
68
 
69
  ## Change these parameters based on how you trained your sliderspace sliders
 
93
  max_sequence_length = 256
94
  flux_pipe = FluxPipeline.from_pretrained(base_model_id, torch_dtype=torch_dtype)
95
  flux_pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch_dtype)
96
+ flux_pipe = flux_pipe.to(device).to(torch_dtype)
97
  # pipe.enable_sequential_cpu_offload()
98
  transformer = flux_pipe.transformer
99
 
 
240
  💻 [GitHub Code](https://github.com/rohitgandikota/sliderspace)
241
  """)
242
 
243
+ gr.Markdown("""
244
+ User Guide: We released sliderspace directions for a few concepts. To test them: <br>
245
+ 1. Choose the concept from the `SliderSpace trained on` menu. (eg. "Wizard")
246
+ 2. Select one of the many directions we discovered for that concept from the `Discovered Directions` menu. (eg. "Direction 3")
247
+ 3. Choose a slider weight between -1 to 1 (recommended). But feel free to explore the scale (eg. +1.5)
248
+ 4. Finally, write a prompt for the concept you chose. (eg. "picture of a wizard fighting a magical war")
249
+ 5. Click Generate and discover what the direction is !!
250
+ """)
251
+
252
  with gr.Row():
253
  prompt = gr.Text(
254
  label="Prompt",
 
270
  with gr.Row():
271
  slider_space = gr.Dropdown(
272
  choices=SDXL_CONCEPTS,
273
+ label="SliderSpace trained on",
274
  value=SDXL_CONCEPTS[0]
275
  )
276
  discovered_directions = gr.Dropdown(