jquesnelle / txt2imghd

A port of GOBIG for Stable Diffusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precision Full Parameter Missing

hooovahh opened this issue · comments

Is there a way to add the --precision full option back in? My 1650 renders a green image every time if I don't have that input. I tried editing the script to force it full, but I haven't had any luck.

Hi
in your txt2imghd.py script Add:

to your imports:

from contextlib import nullcontext

to your option parser around line 356:

parser.add_argument( 
   "--precision",
        type=str,
        help="evaluate at this precision",
       choices=["full", "autocast"],
       default="full" #make your default as you want it to be
    )

Line 440 & 507:

precision_scope = autocast if opt.precision=="autocast" else nullcontext
          with torch.no_grad():

Don't forget to indent as needed.