Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,7 @@ pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(
|
|
30 |
|
31 |
@spaces.GPU
|
32 |
def infer(control_image, prompt, image_2, prompt_2, reference_scale= 0.03 ,
|
|
|
33 |
seed=42, randomize_seed=False, width=1024, height=1024,
|
34 |
guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
35 |
if randomize_seed:
|
@@ -84,6 +85,7 @@ An adapter for FLUX [dev] to create image variations
|
|
84 |
container=False,
|
85 |
)
|
86 |
reference_scale = gr.Slider(
|
|
|
87 |
label="Masking Scale",
|
88 |
minimum=0.01,
|
89 |
maximum=0.08,
|
@@ -115,6 +117,37 @@ An adapter for FLUX [dev] to create image variations
|
|
115 |
|
116 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
with gr.Row():
|
119 |
|
120 |
width = gr.Slider(
|
@@ -154,7 +187,7 @@ An adapter for FLUX [dev] to create image variations
|
|
154 |
gr.on(
|
155 |
triggers=[run_button.click],
|
156 |
fn = infer,
|
157 |
-
inputs = [input_image, prompt, image_2, prompt_2, reference_scale, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
158 |
outputs = [result, seed]
|
159 |
)
|
160 |
|
|
|
30 |
|
31 |
@spaces.GPU
|
32 |
def infer(control_image, prompt, image_2, prompt_2, reference_scale= 0.03 ,
|
33 |
+
prompt_embeds_scale_1 =1, prompt_embeds_scale_2 =1, pooled_prompt_embeds_scale_1 =1, pooled_prompt_embeds_scale_2 =1,
|
34 |
seed=42, randomize_seed=False, width=1024, height=1024,
|
35 |
guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
36 |
if randomize_seed:
|
|
|
85 |
container=False,
|
86 |
)
|
87 |
reference_scale = gr.Slider(
|
88 |
+
info="lower to enhance prompt adherence",
|
89 |
label="Masking Scale",
|
90 |
minimum=0.01,
|
91 |
maximum=0.08,
|
|
|
117 |
|
118 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
119 |
|
120 |
+
with gr.Row():
|
121 |
+
prompt_embeds_scale_1 = gr.Slider(
|
122 |
+
label="prompt embeds scale 1st image",
|
123 |
+
minimum=0,
|
124 |
+
maximum=1.5,
|
125 |
+
step=0.001,
|
126 |
+
value=1,
|
127 |
+
)
|
128 |
+
prompt_embeds_scale_2 = gr.Slider(
|
129 |
+
label="prompt embeds scale 2nd image",
|
130 |
+
minimum=0,
|
131 |
+
maximum=1.5,
|
132 |
+
step=0.001,
|
133 |
+
value=1,
|
134 |
+
)
|
135 |
+
pooled_prompt_embeds_scale_1 = gr.Slider(
|
136 |
+
label="pooled prompt embeds scale 2nd image",
|
137 |
+
minimum=0,
|
138 |
+
maximum=1.5,
|
139 |
+
step=0.001,
|
140 |
+
value=1,
|
141 |
+
)
|
142 |
+
pooled_prompt_embeds_scale_2 = gr.Slider(
|
143 |
+
label="pooled prompt embeds scale 2nd image",
|
144 |
+
minimum=0,
|
145 |
+
maximum=1.5,
|
146 |
+
step=0.001,
|
147 |
+
value=1,
|
148 |
+
)
|
149 |
+
prompt_embeds_scale=[1.25],
|
150 |
+
pooled_prompt_embeds_scale=[1.25]
|
151 |
with gr.Row():
|
152 |
|
153 |
width = gr.Slider(
|
|
|
187 |
gr.on(
|
188 |
triggers=[run_button.click],
|
189 |
fn = infer,
|
190 |
+
inputs = [input_image, prompt, image_2, prompt_2, reference_scale, prompt_embeds_scale_1, prompt_embeds_scale_2, pooled_prompt_embeds_scale_1, pooled_prompt_embeds_scale_2, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
191 |
outputs = [result, seed]
|
192 |
)
|
193 |
|