diff --git a/README.md b/README.md
index b3b782a..93c1bf5 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ AutoML, ByteDance Inc.

[](https://replicate.com/bytedance/res-adapter)
-
+[](https://huggingface.co/spaces/ameerazam08/Res-Adapter-GPU-Demo)
@@ -37,7 +37,8 @@ The above images are generated by ResAdapter with [dreamlike-diffusion-1.0](http
## 🚀 Release
-- `[2024/03/12]` We support [gradio demo](https://replicate.com/bytedance/res-adapter) in `replicate.com` (by [@chenxiwh](https://github.com/chenxwh))
+- `[2024/03/12]` We support [gradio demo with SDXL-Lightning](https://replicate.com/bytedance/res-adapter) in `huggingface.com` (by [@Ameer Azam](https://github.com/AMEERAZAM08))
+- `[2024/03/12]` We support [gradio demo with SDXL-Lightning](https://replicate.com/bytedance/res-adapter) in `replicate.com` (by [@chenxiwh](https://github.com/chenxwh))
- `[2024/03/12]` We release the [resadapter-sdv15](https://huggingface.co/jiaxiangc/res-adapter/tree/main/sd1.5) that supports `128~1024` resolution.
- `[2024/03/05]` We release the paper about [resadapter](https://arxiv.org/abs/2403.02084) to arxiv.
- `[2024/03/04]` We release the inference codes and [resadapter-sdv15-i](https://huggingface.co/jiaxiangc/res-adapter/tree/main/sd1.5-i) that supports `128~512`, and [resadapter-xl-i](https://huggingface.co/jiaxiangc/res-adapter/tree/main/sdxl-i) that supports `256~1024`.
@@ -110,21 +111,27 @@ images = pipe(
save_image(images, f"resadapter_{width}.png", normalize=True, padding=0)
```
-## 🎉 Use ResAdapter in Gradio
+## 🎉 Support ResAdapter in Gradio
-
-🔥 [Update at 2024/03/12] We are happy to provide demos in `replicate.com`.
+🔥 [Update at 2024/03/12] We are happy to provide two demos in `replicate.com` and `huggingface.com`.
Relicate demo: [bytedance/res-adapter](https://replicate.com/bytedance/res-adapter), by ([@chenxiwh](https://github.com/chenxwh))
+Huggingface demo: [ameerazam08/Res-Adapter-GPU-Demo](https://huggingface.co/spaces/ameerazam08/Res-Adapter-GPU-Demo), (by [@Ameer Azam](https://github.com/AMEERAZAM08))
-
+
+


-## 🎉 Use ResAdapter in ComfyUI
+Left: ResAdapter with SDXL-Lightning in `Replicate.com`, Right: ResAdapter with SDXL-Lightning in `Huggingface.com`
-We will support ComfyUI within a week.
+
+
+
+## 🎉 Support ResAdapter in ComfyUI
+
+We will support ComfyUI within a week.
## ⏬ Installation
diff --git a/models/res_adapter/gradio-demo/app.py b/app.py
similarity index 96%
rename from models/res_adapter/gradio-demo/app.py
rename to app.py
index 5c50f1d..450e2be 100644
--- a/models/res_adapter/gradio-demo/app.py
+++ b/app.py
@@ -7,7 +7,7 @@
import numpy as np
import PIL.Image
-import spaces
+# import spaces
import torch
from diffusers import (
StableDiffusionXLPipeline,
@@ -35,7 +35,8 @@
-base = "stabilityai/stable-diffusion-xl-base-1.0"
+# base = "stabilityai/stable-diffusion-xl-base-1.0"
+base = "/mnt/bn/automl-aigc/chengjiaxiang/models/diffusers/dreamshaper-xl-1-0"
repo = "ByteDance/SDXL-Lightning"
ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your step setting!
@@ -66,7 +67,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
return seed
-@spaces.GPU(enable_queue=True)
+# @spaces.GPU(enable_queue=True)
def generate(
prompt: str,
negative_prompt: str = "",
@@ -128,6 +129,7 @@ def generate(
examples = [
"A girl smiling",
+ "A boy smiling",
"A realistic photograph of an astronaut in a jungle, cold color palette, detailed, 8k",
]
@@ -195,14 +197,14 @@ def generate(
minimum=256,
maximum=MAX_IMAGE_SIZE,
step=32,
- value=1024,
+ value=512,
)
height = gr.Slider(
label="Height",
minimum=256,
maximum=MAX_IMAGE_SIZE,
step=32,
- value=1024,
+ value=512,
)
with gr.Row():
guidance_scale_base = gr.Slider(
diff --git a/assets/misc/huggingface_demo.jpeg b/assets/misc/huggingface_demo.jpeg
new file mode 100644
index 0000000..4a0fe4d
Binary files /dev/null and b/assets/misc/huggingface_demo.jpeg differ
diff --git a/assets/misc/replicate_demo.jpeg b/assets/misc/replicate_demo.jpeg
new file mode 100644
index 0000000..605b2e0
Binary files /dev/null and b/assets/misc/replicate_demo.jpeg differ
diff --git a/models/res_adapter/gradio-demo/README.md b/models/res_adapter/gradio-demo/README.md
deleted file mode 100644
index 72e4504..0000000
--- a/models/res_adapter/gradio-demo/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: ResAdapter-GPU-Demo With SDXL-Lightning-Step4
-emoji: 😎
-colorFrom: green
-colorTo: blue
-sdk: gradio
-sdk_version: 4.20.1
-app_file: app.py
-pinned: True
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/models/res_adapter/gradio-demo/requirements.txt b/models/res_adapter/gradio-demo/requirements.txt
deleted file mode 100644
index 8e26b73..0000000
--- a/models/res_adapter/gradio-demo/requirements.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-gradio==4.8.0
-diffusers
-transformers
-accelerate
-safetensors
-huggingface_hub
\ No newline at end of file