replicate / replicate-python

Python client for Replicate
https://replicate.com
Apache License 2.0
770 stars 222 forks source link

Inconsistent output between different flux model #369

Open dulalbert opened 1 month ago

dulalbert commented 1 month ago

Using flux schnell and flux dev output the image in base64 while black-forest-labs/flux-1.1-pro outputs directly the link to the image on replicate server. Is it normal ?

Here is the used call for schnell:

output = replicate.run( "black-forest-labs/flux-schnell", input={ "prompt": "A cake", "go_fast": True, "aspect_ratio": "1:1", "output_quality": 80, "num_inference_steps": 4, "output_format": "jpg", },

AusafG5 commented 1 month ago

Using flux schnell and flux dev output the image in base64 while black-forest-labs/flux-1.1-pro outputs directly the link to the image on replicate server. Is it normal ?

Here is the used call for schnell:

output = replicate.run( "black-forest-labs/flux-schnell", input={ "prompt": "A cake", "go_fast": True, "aspect_ratio": "1:1", "output_quality": 80, "num_inference_steps": 4, "output_format": "jpg", },

same with schnell, wasn't this working before though ? it started blowing up all of a sudden or i'm having some sort of false memory ?

damn, its not consistent even for base64 this is what i am doing rn:

def base64toimage(data):
    if isinstance(data, replicate.helpers.FileOutput):
        data = data.read()
    elif isinstance(data, bytes):
        pass  # bytes already
    else:
        if data.startswith('data:image') or data.startswith('data:application'):
            data = data.split('base64,')[1]
        data = base64.b64decode(data)

    return Image.open(io.BytesIO(data))