oauth
Browse files
README.md
CHANGED
@@ -9,6 +9,8 @@ app_file: app.py
|
|
9 |
pinned: false
|
10 |
license: other
|
11 |
short_description: Transform poses in on-model photos
|
|
|
|
|
12 |
---
|
13 |
|
14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
9 |
pinned: false
|
10 |
license: other
|
11 |
short_description: Transform poses in on-model photos
|
12 |
+
|
13 |
+
hf_oauth: true
|
14 |
---
|
15 |
|
16 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -203,9 +203,12 @@ def load_description(file_path):
|
|
203 |
return content
|
204 |
|
205 |
|
206 |
-
def generate_image(main_image, text_description, did, request: gr.Request):
|
207 |
if not did:
|
208 |
did = str(uuid.uuid4())
|
|
|
|
|
|
|
209 |
if main_image is None:
|
210 |
m = "Please upload both the main image and the background reference image before generating."
|
211 |
return gr.Warning(m), did
|
@@ -402,6 +405,8 @@ with gr.Blocks(css=css) as WeShop:
|
|
402 |
outputs=[output, current_did],
|
403 |
concurrency_limit=None
|
404 |
)
|
|
|
|
|
405 |
with gr.Column():
|
406 |
show_case = gr.Examples(
|
407 |
examples=[
|
|
|
203 |
return content
|
204 |
|
205 |
|
206 |
+
def generate_image(main_image, text_description, did, request: gr.Request, oauth_token: gr.OAuthToken | None):
|
207 |
if not did:
|
208 |
did = str(uuid.uuid4())
|
209 |
+
if not oauth_token:
|
210 |
+
m = "Please log in to your Hugging Face account to use the features of this application."
|
211 |
+
return gr.Warning(m), did
|
212 |
if main_image is None:
|
213 |
m = "Please upload both the main image and the background reference image before generating."
|
214 |
return gr.Warning(m), did
|
|
|
405 |
outputs=[output, current_did],
|
406 |
concurrency_limit=None
|
407 |
)
|
408 |
+
with gr.Row():
|
409 |
+
gr.LoginButton()
|
410 |
with gr.Column():
|
411 |
show_case = gr.Examples(
|
412 |
examples=[
|