Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -7,11 +7,19 @@ while preserving image quality. Powered by ZeroGPU.
|
|
| 7 |
Based on: https://github.com/XuandongZhao/WatermarkAttacker
|
| 8 |
"""
|
| 9 |
|
|
|
|
| 10 |
import gradio as gr
|
| 11 |
import numpy as np
|
| 12 |
import spaces
|
| 13 |
import torch
|
| 14 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
from diffusers import StableDiffusion3Img2ImgPipeline
|
| 16 |
|
| 17 |
# Model configuration
|
|
|
|
| 7 |
Based on: https://github.com/XuandongZhao/WatermarkAttacker
|
| 8 |
"""
|
| 9 |
|
| 10 |
+
import os
|
| 11 |
import gradio as gr
|
| 12 |
import numpy as np
|
| 13 |
import spaces
|
| 14 |
import torch
|
| 15 |
from PIL import Image
|
| 16 |
+
from huggingface_hub import login
|
| 17 |
+
|
| 18 |
+
# Login with HF_TOKEN for gated model access
|
| 19 |
+
if os.environ.get("HF_TOKEN"):
|
| 20 |
+
login(token=os.environ["HF_TOKEN"])
|
| 21 |
+
print("Logged in with HF_TOKEN")
|
| 22 |
+
|
| 23 |
from diffusers import StableDiffusion3Img2ImgPipeline
|
| 24 |
|
| 25 |
# Model configuration
|