Skip to content

Commit

Permalink
pixel perfect (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Sep 22, 2023
1 parent 47747d9 commit c5c1d1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ControlNetUnit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default {
} as ModuleDetail);
const attrNames = ['processor_res', 'threshold_a', 'threshold_b'];
const sliders = [0, 1, 2].map(index => computed(() => {
const sliders = [1, 2].map(index => computed(() => {
if (moduleDetail.value.sliders.length < index + 1 || moduleDetail.value.sliders[index] === null) {
return null;
}
Expand Down Expand Up @@ -188,14 +188,15 @@ export default {
const image = await cropImage(imageBuffer, bounds);
preprocessorInput.value = image;
const processorResolution = Math.min(image.width, image.height);
const response = await fetch(context.detectURL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
controlnet_module: props.unit.module,
controlnet_input_images: [image.dataURL],
controlnet_processor_res: props.unit.processor_res,
controlnet_processor_res: processorResolution,
controlnet_threshold_a: props.unit.threshold_a,
controlnet_threshold_b: props.unit.threshold_b,
}),
Expand Down

0 comments on commit c5c1d1d

Please sign in to comment.