Can't save the API key

Created on 26 April 2024, 7 months ago
Updated 10 May 2024, 7 months ago

Problem/Motivation

I've been trying to use the DreamStudio module, but I'm running into two problems that might be connected.

First, the API key doesn't seem to be saved. I paste it in, hit save, and then it disappears. When I reload the page, it's not there.

Second, this is the error when I try to edit a node and the code tries to generate an image. This is the error that ends up in the logs:

Drupal\ai_interpolator\Exceptions\AiInterpolatorRequestErrorException: The Dreamstudio API returned an error: {"id":"ee9b86b51c7b77af760506c835ff60de","message":"Not Found","name":"not_found"} with code 404 in Drupal\ai_interpolator_dreamstudio\DreamStudio->makeRequest() (line 358 of PATH/modules/contrib/ai_interpolator_dreamstudio/src/DreamStudio.php).
πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bogdog400

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bogdog400
  • Assigned to marcus_johansson
  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    Hi,

    Is the second bug, the same as https://www.drupal.org/project/ai_interpolator_dreamstudio/issues/3444492 πŸ› Exception generated when editing existing field Active ?

    I will try to replicate it.

    Regarding the API key, it is a password field, so you wouldn't see anything there after saving it. What you can try to do is a config export and check the file ai_interpolator_dreamstudio.settings.yml that is created. This should have your api key in it.

  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    @bogdog400 - I found the issue, it was that the engine list is in their legacy API form now, so that's why it got 404. Thanks for notifying.

    If you get the dev version it should be working now. It will be added to RC2 when its released.

  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    Thanks!

  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    @bogdog400, if you have reviewed and its working could you set it to "Reviewed and tested by the community". Thanks

  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    I've downloaded the dev version, but now it's not clear that anything is happening. The image field isn't populated and there aren't any errors in the logs. Or any notes at all.

    Is there something else I can test?

  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    BTW, I think the password feature makes some sense. Maybe you could include some detail like the last three digits of the value to help us in debugging. I can't tell whether it has stuck or not without drilling down into the yml.

    Also, it might be good to be consistent with the Huggingface module because it displays the value in the clear. So that led to some confusion for me.

    Thanks again for everything.

  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    Could you try to resave the field config, if the old field config was there it probably is failing due to that. I'll check if I can add more error handling there.

  • πŸ‡ΊπŸ‡ΈUnited States bogdog400

    I tried several different approaches including creating a new field and creating an entirely new content type. One thought is that the problem might have been caused by having two or three fields all trying to use the same prompt. (My goal is to compare some of the image generators out there by putting their responses all on the same page.)

    Finally after creating an entirely new content type and giving it only the DreamStudio field, I got this error in the logs:

    Message	GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.stability.ai/v1/engines/list in GuzzleHttp\Handler\CurlFactory::createRejection() (line 210 of $PATH/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php).
    

    A bit more that might help:

    Location	$PATH/admin/structure/types/manage/car_illustration_2/fields/node.car_illustration_2.field_t7?_wrapper_format=drupal_ajax&ajax_form=1&destinations%5B0%5D%5Broute_name%5D=entity.node.field_ui_fields&destinations%5B0%5D%5Broute_parameters%5D%5Bfield_config%5D=node.car_illustration_2.field_t7&destinations%5B0%5D%5Broute_parameters%5D%5Bnode_type%5D=car_illustration_2&destinations%5B1%5D=%2Fga%2Fweb%2Fadmin%2Fstructure%2Ftypes%2Fmanage%2Fcar_illustration_2%2Ffields%2Fadd-field
    Referrer	$PATH/admin/structure/types/manage/car_illustration_2/fields/node.car_illustration_2.field_t7?destinations%5B0%5D%5Broute_name%5D=entity.node.field_ui_fields&destinations%5B0%5D%5Broute_parameters%5D%5Bfield_config%5D=node.car_illustration_2.field_t7&destinations%5B0%5D%5Broute_parameters%5D%5Bnode_type%5D=car_illustration_2&destinations%5B1%5D=/ga/web/admin/structure/types/manage/car_illustration_2/fields/add-field
    
    

    Thanks again.

  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    I found the bug and it was a pretty crucial one - the model loader had a typo and the default 1.5 model is not supported anymore. Thank you for being persistant with testing this.

    If you get the dev version and go into the field config and choose a model now, hopefully it works.

Production build 0.71.5 2024