Update app.py
Browse files
app.py
CHANGED
@@ -205,6 +205,7 @@ Mirror: [{data['mirrorUrl']}]({data['mirrorUrl']})
|
|
205 |
# Download images if the model has been downloaded.
|
206 |
downloaded_images = {}
|
207 |
current_image = 1
|
|
|
208 |
if not indimages:
|
209 |
gr.Info(f"Skipping all images.")
|
210 |
else:
|
@@ -295,6 +296,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
|
|
295 |
gr.Info(f"Repository {user_repo_id} already exists, will update it")
|
296 |
update_repo_visibility(repo_id=user_repo_id, private=False, token=oauth_token.token)
|
297 |
|
|
|
298 |
(files, images) = process_url(url, profile, user_repo_id, oauth_token.token, folder, civitai_api_key, nsfw, hidden, indimages)
|
299 |
if not files or len(files.keys()) == 0:
|
300 |
raise gr.Error("No files were copied. Something went wrong.")
|
@@ -378,7 +380,7 @@ Once uploaded, it will add this repository to CivitaiArchive.com as a mirror.
|
|
378 |
)
|
379 |
upload_images = gr.Checkbox(
|
380 |
value=True,
|
381 |
-
interactive=True,
|
382 |
label="Upload images",
|
383 |
info="Optional: Upload images alongside the models for future access. Beware content restrictions."
|
384 |
)
|
@@ -391,7 +393,7 @@ Once uploaded, it will add this repository to CivitaiArchive.com as a mirror.
|
|
391 |
|
392 |
submit_button_civit.click(
|
393 |
fn=upload_civit_to_hf,
|
394 |
-
inputs=[submit_source_civit, destination_repo, civitai_api_key, include_nsfw, include_hidden],
|
395 |
outputs=[output]
|
396 |
)
|
397 |
|
|
|
205 |
# Download images if the model has been downloaded.
|
206 |
downloaded_images = {}
|
207 |
current_image = 1
|
208 |
+
gr.Info(f"SBM get images {indimages}")
|
209 |
if not indimages:
|
210 |
gr.Info(f"Skipping all images.")
|
211 |
else:
|
|
|
296 |
gr.Info(f"Repository {user_repo_id} already exists, will update it")
|
297 |
update_repo_visibility(repo_id=user_repo_id, private=False, token=oauth_token.token)
|
298 |
|
299 |
+
gr.Info(f"SBM get images upload {indimages}")
|
300 |
(files, images) = process_url(url, profile, user_repo_id, oauth_token.token, folder, civitai_api_key, nsfw, hidden, indimages)
|
301 |
if not files or len(files.keys()) == 0:
|
302 |
raise gr.Error("No files were copied. Something went wrong.")
|
|
|
380 |
)
|
381 |
upload_images = gr.Checkbox(
|
382 |
value=True,
|
383 |
+
interactive=True, # Mandatory, otherwise disables the control.
|
384 |
label="Upload images",
|
385 |
info="Optional: Upload images alongside the models for future access. Beware content restrictions."
|
386 |
)
|
|
|
393 |
|
394 |
submit_button_civit.click(
|
395 |
fn=upload_civit_to_hf,
|
396 |
+
inputs=[submit_source_civit, destination_repo, civitai_api_key, include_nsfw, include_hidden, upload_images],
|
397 |
outputs=[output]
|
398 |
)
|
399 |
|