Spaces:
Running
on
Zero
Running
on
Zero
fallenshock
commited on
Commit
·
e932078
1
Parent(s):
1f31600
11
Browse files
app.py
CHANGED
|
@@ -79,18 +79,18 @@ def FlowEditRun(
|
|
| 79 |
|
| 80 |
):
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
# elif model_type == 'FLUX':
|
| 95 |
# try:
|
| 96 |
# huggingface_hub.get_hf_file_metadata(huggingface_hub.hf_hub_url(FLUXSTRING, 'flux1-dev.safetensors'),
|
|
|
|
| 79 |
|
| 80 |
):
|
| 81 |
|
| 82 |
+
if oauth_token is None:
|
| 83 |
+
raise gr.Error("You must be logged in to use Stable Diffusion 3.0 and FLUX.1 models.")
|
| 84 |
+
if model_type == 'SD3':
|
| 85 |
+
try:
|
| 86 |
+
huggingface_hub.get_hf_file_metadata(huggingface_hub.hf_hub_url(SD3STRING, 'sd3_medium.safetensors'),
|
| 87 |
+
token=oauth_token.token)
|
| 88 |
+
print('Has Access')
|
| 89 |
+
# except huggingface_hub.utils._errors.GatedRepoError:
|
| 90 |
+
except huggingface_hub.errors.GatedRepoError:
|
| 91 |
+
raise gr.Error("You need to accept the license agreement to use Stable Diffusion 3. "
|
| 92 |
+
"Visit the <a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>"
|
| 93 |
+
"model page</a> to get access.")
|
| 94 |
# elif model_type == 'FLUX':
|
| 95 |
# try:
|
| 96 |
# huggingface_hub.get_hf_file_metadata(huggingface_hub.hf_hub_url(FLUXSTRING, 'flux1-dev.safetensors'),
|