Spaces:
Runtime error
Runtime error
VikramSingh178
commited on
Commit
β’
f1bf71a
1
Parent(s):
6f7fce9
commit
Browse filesFormer-commit-id: 33b76af3ff90663cc92ee56163dcca8e38dd3f4c
__pycache__/config_settings.cpython-310.pyc
ADDED
Binary file (598 Bytes). View file
|
|
scripts/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (127 Bytes). View file
|
|
scripts/__pycache__/api_utils.cpython-310.pyc
ADDED
Binary file (5.71 kB). View file
|
|
scripts/__pycache__/config.cpython-310.pyc
ADDED
Binary file (2.72 kB). View file
|
|
scripts/__pycache__/s3_manager.cpython-310.pyc
ADDED
Binary file (2.4 kB). View file
|
|
scripts/controlnet_outpainting.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from diffusers import ControlNetModel,StableDiffusionXLControlNetPipeline
|
2 |
+
import torch
|
3 |
+
import requests
|
4 |
+
from PIL import Image
|
5 |
+
from io import BytesIO
|
6 |
+
|
7 |
+
|
8 |
+
controlnet = ControlNetModel.from_pretrained(
|
9 |
+
"destitech/controlnet-inpaint-dreamer-sdxl", torch_dtype=torch.float16, variant="fp16"
|
10 |
+
)
|
11 |
+
|
12 |
+
response = requests.get("https://huggingface.co/datasets/OzzyGT/testing-resources/resolve/main/outpainting/313891870-adb6dc80-2e9e-420c-bac3-f93e6de8d06b.png?download=true")
|
13 |
+
control_image = Image.open('/home/PicPilot/sample_data/example2.jpg')
|
14 |
+
|
15 |
+
|
16 |
+
pipeline = StableDiffusionXLControlNetPipeline.from_pretrained(
|
17 |
+
"RunDiffusion/Juggernaut-XL-v9",
|
18 |
+
torch_dtype=torch.float16,
|
19 |
+
variant="fp16",
|
20 |
+
controlnet=controlnet,
|
21 |
+
).to("cuda")
|
22 |
+
|
23 |
+
image = pipeline(
|
24 |
+
prompt='Showcase 4k',
|
25 |
+
negative_prompt='low Resolution , Bad Resolution',
|
26 |
+
height=1024,
|
27 |
+
width=1024,
|
28 |
+
guidance_scale=7.5,
|
29 |
+
num_inference_steps=100,
|
30 |
+
image=control_image,
|
31 |
+
controlnet_conditioning_scale=0.9,
|
32 |
+
control_guidance_end=0.9,
|
33 |
+
).images[0]
|
34 |
+
|
35 |
+
image.save('output.png')
|