Spaces:
Runtime error
Runtime error
update templates
Browse filesSigned-off-by: AnyISalIn <anyisalin@gmail.com>
00004.jpg
ADDED
|
app.py
CHANGED
|
@@ -71,6 +71,17 @@ def create_ui():
|
|
| 71 |
training_refresh_button = gr.Button(value="Refresh Training Status")
|
| 72 |
training_refresh_json = gr.JSON()
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
def train(novita_key, gender, base_model, training_name, max_train_steps, training_images):
|
| 75 |
training_images = [_.name for _ in training_images]
|
| 76 |
try:
|
|
@@ -233,6 +244,16 @@ def create_ui():
|
|
| 233 |
"style_height": 768,
|
| 234 |
"style_width": 512,
|
| 235 |
"style_reference_image": "./00003.jpg",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
}
|
| 237 |
]
|
| 238 |
|
|
@@ -299,6 +320,7 @@ def create_ui():
|
|
| 299 |
height=height,
|
| 300 |
model_name=style_model,
|
| 301 |
steps=30,
|
|
|
|
| 302 |
)
|
| 303 |
elif style_method == "controlnet-depth":
|
| 304 |
req = Txt2ImgRequest(
|
|
@@ -308,6 +330,7 @@ def create_ui():
|
|
| 308 |
height=height,
|
| 309 |
model_name=style_model,
|
| 310 |
steps=30,
|
|
|
|
| 311 |
controlnet_units=[
|
| 312 |
ControlnetUnit(
|
| 313 |
input_image=image_to_base64(style_reference_image),
|
|
@@ -327,6 +350,7 @@ def create_ui():
|
|
| 327 |
height=height,
|
| 328 |
model_name=style_model,
|
| 329 |
steps=30,
|
|
|
|
| 330 |
controlnet_units=[
|
| 331 |
ControlnetUnit(
|
| 332 |
input_image=image_to_base64(style_reference_image),
|
|
@@ -346,6 +370,7 @@ def create_ui():
|
|
| 346 |
height=height,
|
| 347 |
model_name=style_model,
|
| 348 |
steps=30,
|
|
|
|
| 349 |
controlnet_units=[
|
| 350 |
ControlnetUnit(
|
| 351 |
input_image=image_to_base64(style_reference_image),
|
|
|
|
| 71 |
training_refresh_button = gr.Button(value="Refresh Training Status")
|
| 72 |
training_refresh_json = gr.JSON()
|
| 73 |
|
| 74 |
+
def on_upload_training_images(files):
|
| 75 |
+
if files is None:
|
| 76 |
+
return 2000
|
| 77 |
+
return min(2000, len(files) * 200)
|
| 78 |
+
|
| 79 |
+
training_images.change(
|
| 80 |
+
inputs=[training_images],
|
| 81 |
+
outputs=max_train_steps,
|
| 82 |
+
fn=on_upload_training_images,
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
def train(novita_key, gender, base_model, training_name, max_train_steps, training_images):
|
| 86 |
training_images = [_.name for _ in training_images]
|
| 87 |
try:
|
|
|
|
| 244 |
"style_height": 768,
|
| 245 |
"style_width": 512,
|
| 246 |
"style_reference_image": "./00003.jpg",
|
| 247 |
+
},
|
| 248 |
+
{
|
| 249 |
+
"style_prompt": "Iron Man, close up, digital art, character concept, magical realism, warm golden light, sunset, Marvel Cinematic Universe, Hogwarts, high-resolution, vibrant colors, realistic rendering, key art, fantasy fashion, Iron Man suit integration, elegant and powerful pose",
|
| 250 |
+
"style_negative_prompt": "BadDream_53202, UnrealisticDream_53204",
|
| 251 |
+
"style_gender": "man",
|
| 252 |
+
"style_model": "dreamshaper_8_93211.safetensors",
|
| 253 |
+
"style_method": "controlnet-depth",
|
| 254 |
+
"style_height": 768,
|
| 255 |
+
"style_width": 512,
|
| 256 |
+
"style_reference_image": "./00004.jpg",
|
| 257 |
}
|
| 258 |
]
|
| 259 |
|
|
|
|
| 320 |
height=height,
|
| 321 |
model_name=style_model,
|
| 322 |
steps=30,
|
| 323 |
+
sampler_name=Samplers.DPMPP_M_KARRAS,
|
| 324 |
)
|
| 325 |
elif style_method == "controlnet-depth":
|
| 326 |
req = Txt2ImgRequest(
|
|
|
|
| 330 |
height=height,
|
| 331 |
model_name=style_model,
|
| 332 |
steps=30,
|
| 333 |
+
sampler_name=Samplers.DPMPP_M_KARRAS,
|
| 334 |
controlnet_units=[
|
| 335 |
ControlnetUnit(
|
| 336 |
input_image=image_to_base64(style_reference_image),
|
|
|
|
| 350 |
height=height,
|
| 351 |
model_name=style_model,
|
| 352 |
steps=30,
|
| 353 |
+
sampler_name=Samplers.DPMPP_M_KARRAS,
|
| 354 |
controlnet_units=[
|
| 355 |
ControlnetUnit(
|
| 356 |
input_image=image_to_base64(style_reference_image),
|
|
|
|
| 370 |
height=height,
|
| 371 |
model_name=style_model,
|
| 372 |
steps=30,
|
| 373 |
+
sampler_name=Samplers.DPMPP_M_KARRAS,
|
| 374 |
controlnet_units=[
|
| 375 |
ControlnetUnit(
|
| 376 |
input_image=image_to_base64(style_reference_image),
|