jquesnelle / txt2imghd

A port of GOBIG for Stable Diffusion
MIT License
691 stars 82 forks source link

Precision Full Parameter Missing #19

Open hooovahh opened 2 years ago

hooovahh commented 2 years ago

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.

Amdersiteen commented 1 year ago

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.