Commit
·
8ad8e8f
1
Parent(s):
b90b282
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,12 +8,10 @@ you will find the code to run the model [here](https://github.com/Onkarsus13/Dif
|
|
| 8 |
|
| 9 |
For direct inference
|
| 10 |
|
| 11 |
-
step 1: Clone the
|
| 12 |
-
|
| 13 |
`git clone https://github.com/Onkarsus13/Diff_SceneTextEraser`
|
| 14 |
|
| 15 |
Step2: Go into the repository and install repository, dependency
|
| 16 |
-
|
| 17 |
```
|
| 18 |
cd Diff_SceneTextEraser
|
| 19 |
pip install -e ".[torch]"
|
|
@@ -37,18 +35,14 @@ import math
|
|
| 37 |
import os
|
| 38 |
|
| 39 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 40 |
-
|
| 41 |
model_path = "onkarsus13/controlnet_stablediffusion_scenetextEraser"
|
| 42 |
|
| 43 |
pipe = StableDiffusionControlNetSceneTextErasingPipeline.from_pretrained(model_path)
|
| 44 |
-
|
| 45 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 46 |
-
|
| 47 |
pipe.to(device)
|
| 48 |
|
| 49 |
# pipe.enable_xformers_memory_efficient_attention()
|
| 50 |
pipe.enable_model_cpu_offload()
|
| 51 |
-
|
| 52 |
generator = torch.Generator(device).manual_seed(1)
|
| 53 |
|
| 54 |
image = Image.open("<path to scene text image>").resize((512, 512))
|
|
@@ -63,7 +57,5 @@ image = pipe(
|
|
| 63 |
controlnet_conditioning_scale=1.0,
|
| 64 |
guidance_scale=1.0
|
| 65 |
).images[0]
|
| 66 |
-
|
| 67 |
image.save('test1.png')
|
| 68 |
-
|
| 69 |
```
|
|
|
|
| 8 |
|
| 9 |
For direct inference
|
| 10 |
|
| 11 |
+
step 1: Clone the GitHub repo to get the customized ControlNet-StableDiffusion-inpaint Pipeline Implementation
|
|
|
|
| 12 |
`git clone https://github.com/Onkarsus13/Diff_SceneTextEraser`
|
| 13 |
|
| 14 |
Step2: Go into the repository and install repository, dependency
|
|
|
|
| 15 |
```
|
| 16 |
cd Diff_SceneTextEraser
|
| 17 |
pip install -e ".[torch]"
|
|
|
|
| 35 |
import os
|
| 36 |
|
| 37 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 38 |
model_path = "onkarsus13/controlnet_stablediffusion_scenetextEraser"
|
| 39 |
|
| 40 |
pipe = StableDiffusionControlNetSceneTextErasingPipeline.from_pretrained(model_path)
|
|
|
|
| 41 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
|
| 42 |
pipe.to(device)
|
| 43 |
|
| 44 |
# pipe.enable_xformers_memory_efficient_attention()
|
| 45 |
pipe.enable_model_cpu_offload()
|
|
|
|
| 46 |
generator = torch.Generator(device).manual_seed(1)
|
| 47 |
|
| 48 |
image = Image.open("<path to scene text image>").resize((512, 512))
|
|
|
|
| 57 |
controlnet_conditioning_scale=1.0,
|
| 58 |
guidance_scale=1.0
|
| 59 |
).images[0]
|
|
|
|
| 60 |
image.save('test1.png')
|
|
|
|
| 61 |
```
|