multimodalart HF staff commited on
Commit
e7810b5
·
verified ·
1 Parent(s): 7d06e7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -31
app.py CHANGED
@@ -6,10 +6,10 @@ from diffusers import DiffusionPipeline
6
  import torch
7
 
8
  device = "cuda" if torch.cuda.is_available() else "cpu"
9
- model_repo_id = "stabilityai/sdxl-turbo" #Replace to the model you would like to use
10
 
11
  if torch.cuda.is_available():
12
- torch_dtype = torch.float16
13
  else:
14
  torch_dtype = torch.float32
15
 
@@ -60,36 +60,35 @@ with gr.Blocks(css=css) as demo:
60
  # FLUX.1 [dev] with CFG (and negative prompts)
61
  """)
62
 
 
63
  with gr.Row():
64
- with gr.Row():
65
- prompt = gr.Text(
66
- label="Prompt",
67
- show_label=False,
68
- max_lines=1,
69
- placeholder="Enter your prompt",
70
- container=False,
71
- )
72
- negative_prompt = gr.Text(
73
- label="Negative prompt",
74
- max_lines=1,
75
- placeholder="Enter a negative prompt",
76
- visible=False,
77
- )
78
- with gr.Row():
79
- guidance_scale = gr.Slider(
80
- label="Guidance scale",
81
- minimum=0.0,
82
- maximum=10.0,
83
- step=0.1,
84
- value=1.0, #Replace with defaults that work for your model
85
- )
86
- true_guidance = gr.Slider(
87
- label="True CFG scale",
88
- minimum=0.0,
89
- maximum=10.0,
90
- step=0.1,
91
- value=5.0, #Replace with defaults that work for your model
92
- )
93
  run_button = gr.Button("Run", scale=0)
94
 
95
  result = gr.Image(label="Result", show_label=False)
 
6
  import torch
7
 
8
  device = "cuda" if torch.cuda.is_available() else "cpu"
9
+ model_repo_id = "black-forest-labs/FLUX.1-dev" #Replace to the model you would like to use
10
 
11
  if torch.cuda.is_available():
12
+ torch_dtype = torch.bfloat16
13
  else:
14
  torch_dtype = torch.float32
15
 
 
60
  # FLUX.1 [dev] with CFG (and negative prompts)
61
  """)
62
 
63
+ #with gr.Row():
64
  with gr.Row():
65
+ prompt = gr.Text(
66
+ label="Prompt",
67
+ show_label=False,
68
+ max_lines=1,
69
+ placeholder="Enter your prompt",
70
+ container=False,
71
+ )
72
+ negative_prompt = gr.Text(
73
+ label="Negative prompt",
74
+ max_lines=1,
75
+ placeholder="Enter a negative prompt",
76
+ )
77
+ with gr.Row():
78
+ guidance_scale = gr.Slider(
79
+ label="Guidance scale",
80
+ minimum=0.0,
81
+ maximum=10.0,
82
+ step=0.1,
83
+ value=1.0, #Replace with defaults that work for your model
84
+ )
85
+ true_guidance = gr.Slider(
86
+ label="True CFG scale",
87
+ minimum=0.0,
88
+ maximum=10.0,
89
+ step=0.1,
90
+ value=5.0, #Replace with defaults that work for your model
91
+ )
 
 
92
  run_button = gr.Button("Run", scale=0)
93
 
94
  result = gr.Image(label="Result", show_label=False)