radames HF staff commited on
Commit
37ccbbb
1 Parent(s): 8a9145c
Files changed (2) hide show
  1. app-controlnet.py +1 -1
  2. controlnet/index.html +6 -7
app-controlnet.py CHANGED
@@ -160,7 +160,7 @@ def predict(
160
  result_image = results.images[0]
161
  if params.debug_canny:
162
  # paste control_image on top of result_image
163
- w0, h0 = (128, 128)
164
  control_image = control_image.resize((w0, h0))
165
  w1, h1 = result_image.size
166
  result_image.paste(control_image, (w1 - w0, h1 - h0))
 
160
  result_image = results.images[0]
161
  if params.debug_canny:
162
  # paste control_image on top of result_image
163
+ w0, h0 = (200, 200)
164
  control_image = control_image.resize((w0, h0))
165
  w1, h1 = result_image.size
166
  result_image.paste(control_image, (w1 - w0, h1 - h0))
controlnet/index.html CHANGED
@@ -15,7 +15,6 @@
15
  }
16
  </style>
17
  <script type="module">
18
- // you can change the size of the input image to 768x768 if you have a powerful GPU
19
  const getValue = (id) => {
20
  const el = document.querySelector(`${id}`)
21
  if (el.type === "checkbox")
@@ -76,7 +75,7 @@
76
  function switchCamera() {
77
  const constraints = {
78
  audio: false,
79
- video: { width: 1024, height: 768, deviceId: mediaDevices[webcamsEl.value].deviceId }
80
  };
81
  navigator.mediaDevices
82
  .getUserMedia(constraints)
@@ -145,7 +144,7 @@
145
  });
146
  const constraints = {
147
  audio: false,
148
- video: { width: 1024, height: 768, deviceId: mediaDevices[0].deviceId }
149
  };
150
  navigator.mediaDevices
151
  .getUserMedia(constraints)
@@ -351,17 +350,17 @@
351
  <!-- -->
352
  <label class="text-sm font-medium" for="canny_low_threshold">Canny Low Threshold</label>
353
  <input type="range" id="canny_low_threshold" name="canny_low_threshold" min="0.0" max="1.0"
354
- step="0.001" value="0.2"
355
  oninput="this.nextElementSibling.value = Number(this.value).toFixed(2)">
356
  <output class="text-xs w-[50px] text-center font-light px-1 py-1 border border-gray-700 rounded-md">
357
- 0.2</output>
358
  <!-- -->
359
  <label class="text-sm font-medium" for="canny_high_threshold">Canny High Threshold</label>
360
  <input type="range" id="canny_high_threshold" name="canny_high_threshold" min="0.0" max="1.0"
361
- step="0.001" value="0.8"
362
  oninput="this.nextElementSibling.value = Number(this.value).toFixed(2)">
363
  <output class="text-xs w-[50px] text-center font-light px-1 py-1 border border-gray-700 rounded-md">
364
- 0.8</output>
365
  <!-- -->
366
  <label class="text-sm font-medium" for="seed">Seed</label>
367
  <input type="number" id="seed" name="seed" value="299792458"
 
15
  }
16
  </style>
17
  <script type="module">
 
18
  const getValue = (id) => {
19
  const el = document.querySelector(`${id}`)
20
  if (el.type === "checkbox")
 
75
  function switchCamera() {
76
  const constraints = {
77
  audio: false,
78
+ video: { width: 1024, height: 1024, deviceId: mediaDevices[webcamsEl.value].deviceId }
79
  };
80
  navigator.mediaDevices
81
  .getUserMedia(constraints)
 
144
  });
145
  const constraints = {
146
  audio: false,
147
+ video: { width: 1024, height: 1024, deviceId: mediaDevices[0].deviceId }
148
  };
149
  navigator.mediaDevices
150
  .getUserMedia(constraints)
 
350
  <!-- -->
351
  <label class="text-sm font-medium" for="canny_low_threshold">Canny Low Threshold</label>
352
  <input type="range" id="canny_low_threshold" name="canny_low_threshold" min="0.0" max="1.0"
353
+ step="0.001" value="0.1"
354
  oninput="this.nextElementSibling.value = Number(this.value).toFixed(2)">
355
  <output class="text-xs w-[50px] text-center font-light px-1 py-1 border border-gray-700 rounded-md">
356
+ 0.1</output>
357
  <!-- -->
358
  <label class="text-sm font-medium" for="canny_high_threshold">Canny High Threshold</label>
359
  <input type="range" id="canny_high_threshold" name="canny_high_threshold" min="0.0" max="1.0"
360
+ step="0.001" value="0.2"
361
  oninput="this.nextElementSibling.value = Number(this.value).toFixed(2)">
362
  <output class="text-xs w-[50px] text-center font-light px-1 py-1 border border-gray-700 rounded-md">
363
+ 0.2</output>
364
  <!-- -->
365
  <label class="text-sm font-medium" for="seed">Seed</label>
366
  <input type="number" id="seed" name="seed" value="299792458"