multimodalart HF staff commited on
Commit
8049e0c
1 Parent(s): 07d0ab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -45
app.py CHANGED
@@ -274,51 +274,45 @@ def update_pricing(steps, oauth_token: Union[gr.OAuthToken, None]):
274
  else:
275
  return gr.update(visible=False), "", gr.update(visible=False), gr.update(visible=True)
276
 
277
- config_yaml = {
278
- "device": "cuda:0",
279
- "network": {
280
- "type": "lora",
281
- "linear": 16,
282
- "linear_alpha": 16
283
- },
284
- "save": {
285
- "dtype": "float16",
286
- "save_every": 10000,
287
- "max_step_saves_to_keep": 4,
288
- "push_to_hub": True,
289
- "hf_private": True
290
- },
291
- "train": {
292
- "batch_size": 1,
293
- "gradient_accumulation_steps": 1,
294
- "train_unet": True,
295
- "train_text_encoder": False,
296
- "gradient_checkpointing": True,
297
- "noise_scheduler": "flowmatch",
298
- "optimizer": "adamw8bit",
299
- "ema_config": {
300
- "use_ema": True,
301
- "ema_decay": 0.99
302
- },
303
- "dtype": "bf16"
304
- },
305
- "model": {
306
- "name_or_path": "black-forest-labs/FLUX.1-dev",
307
- "is_flux": True,
308
- "quantize": True
309
- },
310
- "sample": {
311
- "sampler": "flowmatch",
312
- "sample_every": 1000,
313
- "width": 1024,
314
- "height": 1024,
315
- "neg": "",
316
- "seed": 42,
317
- "walk_seed": True,
318
- "guidance_scale": 3.5,
319
- "sample_steps": 28
320
- }
321
- }
322
 
323
  theme = gr.themes.Monochrome(
324
  text_size=gr.themes.Size(lg="18px", md="15px", sm="13px", xl="22px", xs="12px", xxl="24px", xxs="9px"),
 
274
  else:
275
  return gr.update(visible=False), "", gr.update(visible=False), gr.update(visible=True)
276
 
277
+ config_yaml = '''
278
+ device: cuda:0
279
+ model:
280
+ is_flux: true
281
+ name_or_path: black-forest-labs/FLUX.1-dev
282
+ quantize: true
283
+ network:
284
+ linear: 16 #it will overcome the 'rank' parameter
285
+ linear_alpha: 16 #you can have an alpha different than the ranking if you'd like
286
+ type: lora
287
+ sample:
288
+ guidance_scale: 3.5
289
+ height: 1024
290
+ neg: '' #doesn't work for FLUX
291
+ sample_every: 1000
292
+ sample_steps: 28
293
+ sampler: flowmatch
294
+ seed: 42
295
+ walk_seed: true
296
+ width: 1024
297
+ save:
298
+ dtype: float16
299
+ hf_private: true
300
+ max_step_saves_to_keep: 4
301
+ push_to_hub: true
302
+ save_every: 10000
303
+ train:
304
+ batch_size: 1
305
+ dtype: bf16
306
+ ema_config:
307
+ ema_decay: 0.99
308
+ use_ema: true
309
+ gradient_accumulation_steps: 1
310
+ gradient_checkpointing: true
311
+ noise_scheduler: flowmatch
312
+ optimizer: adamw8bit #options: prodigy, dadaptation, adamw, adamw8bit, lion, lion8bit
313
+ train_text_encoder: false #probably doesn't work for flux
314
+ train_unet: true
315
+ '''
 
 
 
 
 
 
316
 
317
  theme = gr.themes.Monochrome(
318
  text_size=gr.themes.Size(lg="18px", md="15px", sm="13px", xl="22px", xs="12px", xxl="24px", xxs="9px"),