Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for image generation up to 1024x1024 #214

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/stable_diffusion_tf/stable_diffusion_tf/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ def td_dot(a, b):
bb = tf.reshape(b, (-1, b.shape[2], b.shape[3]))
cc = tf.keras.backend.batch_dot(aa, bb)
ans = tf.reshape(cc, (-1, a.shape[1], cc.shape[1], cc.shape[2]))
assert ans.shape[1] * ans.shape[2] * ans.shape[3] < 8*4096*4096 - 1000 , "Shape too large"
# Gavin, 20221012: Updated from `8*4096*4096 - 1000` to `16*4096*4096 + 1` to accomodate up to 1024x1024 images
assert ans.shape[1] * ans.shape[2] * ans.shape[3] < 16*4096*4096 + 1 , "Shape too large"
return ans
6 changes: 4 additions & 2 deletions electron_app/src/components/ImgGenerate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@

<b-form-group inline label="" style="margin-bottom: 6px;">
<label class="mr-sm-2" style="margin-right: 8px ;" for="inline-form-custom-select-pref">Image Height: </label>
<!-- Gavin, 20221012: Added options to accomodate up to 1024x1024 images -->
<b-form-select
v-model="img_h"
:options="[ 64*4 , 64*5 , 64*6, 64*7 , 64*8 , 64*9 , 64*10 , 64*11 , 64*12 ]"
:options="[ 64*4 , 64*5 , 64*6, 64*7 , 64*8 , 64*9 , 64*10 , 64*11 , 64*12, 64*13, 64*14, 64*15, 64*16 ]"
required
></b-form-select>
</b-form-group>

<b-form-group inline label="" style="margin-bottom: 6px;">
<label class="mr-sm-2" style="margin-right: 8px ;" for="inline-form-custom-select-pref">Image Width: </label>
<!-- Gavin, 20221012: Added options to accomodate up to 1024x1024 images -->
<b-form-select
v-model="img_w"
:options="[64*4 , 64*5 , 64*6, 64*7 , 64*8 , 64*9 , 64*10 , 64*11 , 64*12 ]"
:options="[ 64*4 , 64*5 , 64*6, 64*7 , 64*8 , 64*9 , 64*10 , 64*11 , 64*12, 64*13, 64*14, 64*15, 64*16 ]"
required
></b-form-select>
</b-form-group>
Expand Down